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


PHP WPSEO_Utils::get_plugin_name方法代码示例

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


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

示例1: set_error

 /**
  * Setting an error on the screen
  *
  * @param string $plugin_section
  * @param string $readable_plugin_section This is the value for the translation.
  */
 protected function set_error($plugin_section, $readable_plugin_section)
 {
     $plugins_as_string = $this->get_conflicting_plugins_as_string($plugin_section);
     $error_message = '<h3>' . __('Warning!', 'wordpress-seo') . '</h3>';
     /* translators: %1$s: 'Facebook & Open Graph' plugin name(s) of possibly conflicting plugin(s), %2$s to Yoast SEO */
     $error_message .= '<p>' . sprintf(__('The %1$s plugin(s) might cause issues when used in conjunction with %2$s.', 'wordpress-seo'), $plugins_as_string, 'Yoast SEO') . '</p>';
     $error_message .= sprintf($readable_plugin_section, 'Yoast SEO', $plugins_as_string) . '<br/><br/>';
     $error_message .= '<p><strong>' . __('Recommended solution', 'wordpress-seo') . '</strong><br/>';
     /* translators: %1$s: 'Facebook & Open Graph' plugin name(s) of possibly conflicting plugin(s). %2$s to Yoast SEO */
     $error_message .= sprintf(__('We recommend you deactivate %1$s and have another look at your %2$s configuration using the button above.', 'wordpress-seo'), $plugins_as_string, 'Yoast SEO') . '</p>';
     foreach ($this->active_plugins[$plugin_section] as $plugin_file) {
         /* translators: %s: 'Facebook' plugin name of possibly conflicting plugin */
         $error_message .= '<a target="_blank" class="button-primary" href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=all', 'deactivate-plugin_' . $plugin_file) . '">' . sprintf(__('Deactivate %s', 'wordpress-seo'), WPSEO_Utils::get_plugin_name($plugin_file)) . '</a> ';
     }
     /* translators: %1$s expands to Yoast SEO */
     $error_message .= '<p class="alignright"><small>' . sprintf(__('This warning is generated by %1$s.', 'wordpress-seo'), 'Yoast SEO') . '</small></p><div class="clear"></div>';
     // Add the message to the notifications center.
     Yoast_Notification_Center::get()->add_notification(new Yoast_Notification($error_message, array('type' => 'error yoast-dismissible', 'id' => 'wpseo-dismiss-plugin-conflict', 'nonce' => wp_create_nonce('dismiss-plugin-conflict'), 'data_json' => array('section' => $plugin_section, 'plugins' => $this->active_plugins[$plugin_section]))));
 }
开发者ID:jabrankhalil,项目名称:websolution,代码行数:25,代码来源:class-yoast-plugin-conflict.php

示例2: set_error

 /**
  * Setting an error on the screen
  *
  * @param string $plugin_section          Type of conflict group (such as Open Graph or sitemap).
  * @param string $readable_plugin_section This is the value for the translation.
  */
 protected function set_error($plugin_section, $readable_plugin_section)
 {
     $notification_center = Yoast_Notification_Center::get();
     foreach ($this->active_plugins[$plugin_section] as $plugin_file) {
         $plugin_name = WPSEO_Utils::get_plugin_name($plugin_file);
         $error_message = '';
         /* translators: %1$s: 'Facebook & Open Graph' plugin name(s) of possibly conflicting plugin(s), %2$s to Yoast SEO */
         $error_message .= '<p>' . sprintf(__('The %1$s plugin might cause issues when used in conjunction with %2$s.', 'wordpress-seo'), '<em>' . $plugin_name . '</em>', 'Yoast SEO') . '</p>';
         $error_message .= '<p>' . sprintf($readable_plugin_section, 'Yoast SEO', $plugin_name) . '</p>';
         /* translators: %s: 'Facebook' plugin name of possibly conflicting plugin */
         $error_message .= '<a target="_blank" class="button-primary" href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=all', 'deactivate-plugin_' . $plugin_file) . '">' . sprintf(__('Deactivate %s', 'wordpress-seo'), WPSEO_Utils::get_plugin_name($plugin_file)) . '</a> ';
         $identifier = $this->get_notification_identifier($plugin_file);
         // Add the message to the notifications center.
         $notification_center->add_notification(new Yoast_Notification($error_message, array('type' => Yoast_Notification::ERROR, 'id' => 'wpseo-conflict-' . $identifier)));
     }
 }
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:22,代码来源:class-yoast-plugin-conflict.php


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