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


PHP WPSEO_Meta::keyword_usage方法代码示例

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


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

示例1: item_to_response

 /**
  * Map the posts to a response array
  *
  * @param WP_Post $item The post for which to build the analyzer data.
  *
  * @return array
  */
 protected function item_to_response($item)
 {
     $focus_keyword = WPSEO_Meta::get_value('focuskw', $item->ID);
     $content = $item->post_content;
     /**
      * Filter the post content for use in the SEO score recalculation.
      *
      * @param string $content Content of the post. Modify to reflect front-end content.
      * @param WP_Post $item The Post object the content comes from.
      */
     $content = apply_filters('wpseo_post_content_for_recalculation', $content, $item);
     // Apply shortcodes.
     $content = do_shortcode($content);
     return array('post_id' => $item->ID, 'text' => $content, 'keyword' => $focus_keyword, 'url' => urldecode($item->post_name), 'pageTitle' => apply_filters('wpseo_title', wpseo_replace_vars($this->get_title($item->ID, $item->post_type), $item)), 'meta' => apply_filters('wpseo_metadesc', wpseo_replace_vars($this->get_meta_description($item->ID, $item->post_type), $item)), 'keyword_usage' => array($focus_keyword => WPSEO_Meta::keyword_usage($focus_keyword, $item->ID)));
 }
开发者ID:Didox,项目名称:beminfinito,代码行数:22,代码来源:class-recalculate-posts.php

示例2: get_focus_keyword_usage

 /**
  * Counting the number of given keyword used for other posts than given post_id
  *
  * @return array
  */
 private function get_focus_keyword_usage()
 {
     $post = $this->get_metabox_post();
     if (is_object($post)) {
         $keyword = WPSEO_Meta::get_value('focuskw', $post->ID);
         return array($keyword => WPSEO_Meta::keyword_usage($keyword, $post->ID));
     }
     return array();
 }
开发者ID:domalexxx,项目名称:nashvancouver,代码行数:14,代码来源:class-metabox.php

示例3: post_to_response

 /**
  * @param WP_Post $post The post for which to build the analyzer data.
  *
  * @return array
  */
 private function post_to_response(WP_Post $post)
 {
     $focus_keyword = WPSEO_Meta::get_value('focuskw', $post->ID);
     return array('post_id' => $post->ID, 'text' => $post->post_content, 'keyword' => $focus_keyword, 'url' => urldecode($post->post_name), 'pageTitle' => apply_filters('wpseo_title', wpseo_replace_vars($this->get_title($post->ID, $post->post_type), $post)), 'meta' => apply_filters('wpseo_metadesc', wpseo_replace_vars($this->get_meta_description($post->ID, $post->post_type), $post)), 'keyword_usage' => array($focus_keyword => WPSEO_Meta::keyword_usage($focus_keyword, $post->ID)));
 }
开发者ID:healthcommcore,项目名称:osnap,代码行数:10,代码来源:class-recalculate-scores-ajax.php

示例4: ajax_get_keyword_usage

/**
 * Retrieves the keyword for the keyword doubles.
 */
function ajax_get_keyword_usage()
{
    $post_id = filter_input(INPUT_POST, 'post_id');
    $keyword = filter_input(INPUT_POST, 'keyword');
    wp_die(WPSEO_Utils::json_encode(WPSEO_Meta::keyword_usage($keyword, $post_id)));
}
开发者ID:healthcommcore,项目名称:osnap,代码行数:9,代码来源:ajax.php

示例5: ajax_get_keyword_usage

/**
 * Retrieves the keyword for the keyword doubles.
 */
function ajax_get_keyword_usage()
{
    $post_id = filter_input(INPUT_POST, 'post_id');
    $keyword = filter_input(INPUT_POST, 'keyword');
    if (!current_user_can('edit_post', $post_id)) {
        die('-1');
    }
    wp_die(wp_json_encode(WPSEO_Meta::keyword_usage($keyword, $post_id)));
}
开发者ID:AnkushVarshneya,项目名称:wordpress-theme,代码行数:12,代码来源:ajax.php

示例6: get_focus_keyword_usage

 /**
  * Counting the number of given keyword used for other posts than given post_id
  *
  * @return array
  */
 private function get_focus_keyword_usage()
 {
     $keyword = WPSEO_Meta::get_value('focuskw', $this->post->ID);
     return array($keyword => WPSEO_Meta::keyword_usage($keyword, $this->post->ID));
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:10,代码来源:class-post-metabox-formatter.php


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