PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
sitepress-multilingual-cms
/
classes
/
notices
<?php namespace WPML\Notices; class DismissNotices implements \IWPML_Backend_Action { const OPTION = 'wpml_dismiss_notice'; const CSS_CLASS = 'wpml_dismiss_notice'; public function add_hooks() { add_action( 'wp_ajax_wpml_dismiss_notice', [ $this, 'toggleDismiss' ] ); add_action( 'admin_enqueue_scripts', function () { wp_enqueue_script( 'wpml-dismiss-notice', ICL_PLUGIN_URL . '/dist/js/notices/app.js', [], ICL_SITEPRESS_VERSION ); } ); } public function toggleDismiss() { $postData = wpml_collect( $_POST ); $id = $postData->get( 'id', null ); if ( ! $id ) { return wp_send_json_error( 'ID of notice is not defined' ); } $options = get_option( self::OPTION, [] ); $options[ $id ] = $postData->get( 'dismiss', false ) === 'true'; update_option( self::OPTION, $options ); return wp_send_json_success(); } /** * @param int $id * * @return bool */ public function isDismissed( $id ) { return wpml_collect( get_option( self::OPTION, [] ) )->get( $id, false ); } /** * @param int $id * * @return string */ public function renderCheckbox( $id ) { return sprintf( '<input type="checkbox" class="%s" data-id="%s" />', self::CSS_CLASS, $id ); } }
[-] DismissNotices.php
[edit]
[-] AteLockNotice.php
[edit]
[+]
pages
[-] class-wpml-notice.php
[edit]
[+]
translation-service-instruction
[+]
translation-jobs-migration
[-] class-wpml-notices.php
[edit]
[-] wpml-tm-post-edit-notices.php
[edit]
[-] class-wpml-notice-render.php
[edit]
[-] wpml-tm-post-edit-notices-factory.php
[edit]
[+]
..
[-] class-wpml-notice-action.php
[edit]