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


PHP WPSEO_Taxonomy_Meta::get_keyword_usage方法代码示例

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


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

示例1: item_to_response

 /**
  * Convert the given term into a analyzable object.
  *
  * @param mixed $item The term for which to build the analyzer data.
  *
  * @return array
  */
 protected function item_to_response($item)
 {
     $focus_keyword = $this->get_focus_keyword($item);
     $title = str_replace(' %%page%% ', ' ', $this->get_title($item));
     $meta = $this->get_meta_description($item);
     $description = $item->description;
     /**
      * Filter the term description for recalculation.
      *
      * @param string $description Content of the term. Modify to reflect front-end content.
      * @oaram WP_Term $item The term the description comes from.
      */
     $description = apply_filters('wpseo_term_description_for_recalculation', $description, $item);
     return array('term_id' => $item->term_id, 'taxonomy' => $item->taxonomy, 'text' => $description, 'keyword' => $focus_keyword, 'url' => urldecode($item->slug), 'pageTitle' => apply_filters('wpseo_title', wpseo_replace_vars($title, $item, array('page'))), 'meta' => apply_filters('wpseo_metadesc', wpseo_replace_vars($meta, $item)), 'keyword_usage' => array($focus_keyword => WPSEO_Taxonomy_Meta::get_keyword_usage($focus_keyword, $item->term_id, $item->taxonomy)));
 }
开发者ID:Didox,项目名称:beminfinito,代码行数:22,代码来源:class-recalculate-terms.php

示例2: localize_term_scraper_script

 /**
  * Pass variables to js for use with the term-scraper
  *
  * @return array
  */
 public function localize_term_scraper_script()
 {
     $translations = $this->get_scraper_translations();
     $term_id = filter_input(INPUT_GET, 'tag_ID');
     $term = get_term_by('id', $term_id, $this->get_taxonomy());
     $focuskw = WPSEO_Taxonomy_Meta::get_term_meta($term, $term->taxonomy, 'focuskw');
     $taxonomy = get_taxonomy($term->taxonomy);
     $options = WPSEO_Options::get_all();
     $base_url = home_url('/', null);
     if (!$options['stripcategorybase']) {
         $base_url = trailingslashit($base_url . $taxonomy->rewrite['slug']);
     }
     return array('translations' => $translations, 'base_url' => $base_url, 'taxonomy' => $term->taxonomy, 'keyword_usage' => WPSEO_Taxonomy_Meta::get_keyword_usage($focuskw, $term->term_id, $term->taxonomy), 'search_url' => admin_url('edit-tags.php?taxonomy=' . $term->taxonomy . '&seo_kw_filter={keyword}'), 'post_edit_url' => admin_url('edit-tags.php?action=edit&taxonomy=' . $term->taxonomy . '&tag_ID={id}'), 'title_template' => WPSEO_Taxonomy::get_title_template($term), 'metadesc_template' => WPSEO_Taxonomy::get_metadesc_template($term), 'contentTab' => __('Content:', 'wordpress-seo'));
 }
开发者ID:healthcommcore,项目名称:osnap,代码行数:19,代码来源:class-taxonomy.php

示例3: ajax_get_term_keyword_usage

/**
 * Retrieves the keyword for the keyword doubles of the termpages.
 */
function ajax_get_term_keyword_usage()
{
    $post_id = filter_input(INPUT_POST, 'post_id');
    $keyword = filter_input(INPUT_POST, 'keyword');
    $taxonomy = filter_input(INPUT_POST, 'taxonomy');
    wp_die(WPSEO_Utils::json_encode(WPSEO_Taxonomy_Meta::get_keyword_usage($keyword, $post_id, $taxonomy)));
}
开发者ID:healthcommcore,项目名称:osnap,代码行数:10,代码来源:ajax.php

示例4: ajax_get_term_keyword_usage

/**
 * Retrieves the keyword for the keyword doubles of the termpages.
 */
function ajax_get_term_keyword_usage()
{
    $post_id = filter_input(INPUT_POST, 'post_id');
    $keyword = filter_input(INPUT_POST, 'keyword');
    $taxonomyName = filter_input(INPUT_POST, 'taxonomy');
    $taxonomy = get_taxonomy($taxonomyName);
    if (!$taxonomy) {
        wp_die(0);
    }
    if (!current_user_can($taxonomy->cap->edit_terms)) {
        wp_die(-1);
    }
    $usage = WPSEO_Taxonomy_Meta::get_keyword_usage($keyword, $post_id, $taxonomyName);
    // Normalize the result so it it the same as the post keyword usage AJAX request.
    $usage = $usage[$keyword];
    wp_die(wp_json_encode($usage));
}
开发者ID:AnkushVarshneya,项目名称:wordpress-theme,代码行数:20,代码来源:ajax.php

示例5: get_focus_keyword_usage

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

示例6: ajax_get_term_keyword_usage

/**
 * Retrieves the keyword for the keyword doubles of the termpages.
 */
function ajax_get_term_keyword_usage()
{
    $post_id = filter_input(INPUT_POST, 'post_id');
    $keyword = filter_input(INPUT_POST, 'keyword');
    $taxonomy = filter_input(INPUT_POST, 'taxonomy');
    if (!current_user_can('edit_terms')) {
        die('-1');
    }
    $usage = WPSEO_Taxonomy_Meta::get_keyword_usage($keyword, $post_id, $taxonomy);
    // Normalize the result so it it the same as the post keyword usage AJAX request.
    $usage = $usage[$keyword];
    wp_die(WPSEO_Utils::json_encode($usage));
}
开发者ID:designomx,项目名称:DMXFrmwrk,代码行数:16,代码来源:ajax.php


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