当前位置: 首页>>代码示例>>PHP>>正文


PHP ICL_AdminNotifier::remove_message_group方法代码示例

本文整理汇总了PHP中ICL_AdminNotifier::remove_message_group方法的典型用法代码示例。如果您正苦于以下问题:PHP ICL_AdminNotifier::remove_message_group方法的具体用法?PHP ICL_AdminNotifier::remove_message_group怎么用?PHP ICL_AdminNotifier::remove_message_group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICL_AdminNotifier的用法示例。


在下文中一共展示了ICL_AdminNotifier::remove_message_group方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: missing_php_extensions

 private function missing_php_extensions()
 {
     $extensions = array();
     if (ini_get('allow_url_fopen') !== '1') {
         $extensions['allow_url_fopen'] = array('type' => 'setting', 'type_description' => __('PHP Setting', 'wpml-translation-management'), 'value' => '1');
     }
     if (!extension_loaded('openssl')) {
         $extensions['openssl'] = array('type' => 'extension', 'type_description' => __('PHP Extension', 'wpml-translation-management'));
     }
     if (class_exists('ICL_AdminNotifier') && (!defined('ICL_HIDE_TRANSLATION_SERVICES') || !ICL_HIDE_TRANSLATION_SERVICES)) {
         $wpml_wp_api_check = new WPML_WP_API();
         if (count($extensions) > 0 && $wpml_wp_api_check->is_tm_page()) {
             $message = '';
             $message .= '<p>';
             $message .= __('WPML Translation Management requires the following PHP extensions and settings:', 'wpml-translation-management');
             $message .= '</p>';
             $message .= '<ul>';
             foreach ($extensions as $id => $data) {
                 $message .= '<li>';
                 if ('setting' === $data['type']) {
                     $message .= $data['type_description'] . ': <code>' . $id . '=' . $data['value'] . '</code>';
                 }
                 if ('extension' === $data['type']) {
                     $message .= $data['type_description'] . ': <strong>' . $id . '</strong>';
                 }
                 $message .= '</li>';
             }
             $message .= '</ul>';
             $args = array('id' => 'wpml-tm-missing-extensions', 'group' => 'wpml-tm-requirements', 'msg' => $message, 'type' => 'error', 'admin_notice' => true, 'hide' => true);
             ICL_AdminNotifier::add_message($args);
         } else {
             ICL_AdminNotifier::remove_message_group('wpml-tm-requirements');
         }
     }
 }
开发者ID:Alexg10,项目名称:Egzobeatbox,代码行数:35,代码来源:class-wpml-tm-requirements.php

示例2: promote_wcml_message

 public function promote_wcml_message()
 {
     $promote = false;
     if (class_exists('WooCommerce') && !class_exists('woocommerce_wpml')) {
         global $pagenow;
         $promote = $this->wpml_wp_api->is_tm_page();
         if (isset($_GET['post_type']) && !empty($_GET['post_type'])) {
             $promote = 'product' === $_GET['post_type'] && 'edit.php' === $pagenow;
         }
     }
     if ($promote) {
         $message = '';
         $wcml_link = '<a href="https://wordpress.org/plugins/woocommerce-multilingual" target="_blank">WooCommerce Multilingual.</a>';
         $message .= sprintf(__('Looks like you are running a multilingual WooCommerce site. To easily translate WooCommerce products and categories, you should use %s', 'wpml-translation-management'), $wcml_link);
         $args = array('id' => 'promote-wcml', 'group' => 'promote-wcml', 'msg' => $message, 'type' => 'notice', 'admin_notice' => true, 'hide' => true);
         ICL_AdminNotifier::add_message($args);
     } else {
         ICL_AdminNotifier::remove_message_group('promote-wcml');
     }
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:20,代码来源:class-wpml-tm-promotions.php

示例3: update_basket_notifications

 /**
  * Register notification with number of items in basket and link to basket
  */
 public static function update_basket_notifications()
 {
     $positions = self::get_basket_notification_positions();
     $basket_link = "admin.php?page=" . WPML_TM_FOLDER . "/menu/main.php&sm=basket";
     foreach ($positions as $position => $group) {
         ICL_AdminNotifier::remove_message_group($position);
     }
     self::get_basket();
     $basket_items_count = self::get_basket_items_count(true);
     // if we have something in the basket
     if ($basket_items_count > 0 && (!isset($_GET['clear_basket']) || $_GET['clear_basket'] != 1) && (!isset($_GET['action']) || $_GET['action'] != 'delete')) {
         $text = __('The items you have selected are now in the translation basket &ndash;', 'wpml-translation-management');
         $text .= ' ' . sprintf(__('<a href="%s">Send to translation &raquo;</a>', 'wpml-translation-management'), $basket_link);
         // translation management pages
         $message_args = array('id' => $positions['tm_dashboard_top'], 'text' => $text, 'classes' => 'small', 'type' => 'information small', 'group' => $positions['tm_dashboard_top'], 'admin_notice' => false, 'hide_per_user' => false, 'dismiss_per_user' => false, 'capability' => 'manage_options');
         ICL_AdminNotifier::add_message($message_args);
     } else {
         ICL_AdminNotifier::remove_message($positions['tm_dashboard_top']);
     }
     $admin_basket_message_id = $positions['admin_notice'];
     if (self::$messages || $basket_items_count > 0) {
         $additional_messages = array();
         if (isset(self::$messages) && is_array(self::$messages)) {
             foreach (self::$messages as $message) {
                 $additional_messages[] = $message['text'];
             }
         }
         $additional_messages_text = '';
         if (count($additional_messages) > 0) {
             $additional_messages_text = '<ul><li>' . implode('</li><li>', $additional_messages) . '</li></ul>';
         }
         $limit_to_page = array();
         $limit_to_page[] = WPML_TM_FOLDER . '/menu/main.php';
         $message_args = array('id' => $admin_basket_message_id, 'text' => $additional_messages_text, 'classes' => 'small', 'type' => 'information', 'group' => $admin_basket_message_id, 'admin_notice' => true, 'hide_per_user' => false, 'dismiss_per_user' => false, 'limit_to_page' => $limit_to_page, 'show_once' => true);
         if (trim($additional_messages_text) != '') {
             ICL_AdminNotifier::add_message($message_args);
         }
     } else {
         ICL_AdminNotifier::remove_message($admin_basket_message_id);
     }
 }
开发者ID:studiopengpeng,项目名称:ASCOMETAL,代码行数:44,代码来源:translationproxy-basket.class.php


注:本文中的ICL_AdminNotifier::remove_message_group方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。