translate_meta_boxes() 공개 정적인 메소드

IMPORTANT: if you want to add a new string (option) somewhere, make sure you add that array key to the main meta box definition array in the class WPSEO_Meta() as well!!!!
public static translate_meta_boxes ( )
 private static function meta($object_id, $meta_key, $meta_value)
 {
     $prefix = WPSEO_Meta::$meta_prefix;
     WPSEO_Metabox::translate_meta_boxes();
     if (0 !== strpos($meta_key, $prefix)) {
         return;
     }
     $key = str_replace($prefix, '', $meta_key);
     foreach (WPSEO_Meta::$meta_fields as $tab => $fields) {
         if (isset($fields[$key])) {
             $field = $fields[$key];
             break;
         }
     }
     if (!isset($field, $field['title'], $tab) || '' === $field['title']) {
         return;
     }
     $post = get_post($object_id);
     $post_type_label = get_post_type_labels(get_post_type_object($post->post_type))->singular_name;
     self::log(sprintf(__('Updated "%1$s" of "%2$s" %3$s', 'stream'), $field['title'], $post->post_title, $post_type_label), array('meta_key' => $meta_key, 'meta_value' => $meta_value, 'post_type' => $post->post_type), $object_id, 'wpseo_meta', 'updated');
 }
예제 #2
0
파일: curl.php 프로젝트: shellygraham/tag
 function _initialize_yoast()
 {
     wpseo_init();
     wpseo_admin_init();
     wpseo_load_textdomain();
     $options = WPSEO_Options::get_all();
     new WPSEO_Metabox();
     WPSEO_Metabox::translate_meta_boxes();
     if ($options['opengraph'] === true || $options['twitter'] === true || $options['googleplus'] === true) {
         new WPSEO_Social_Admin();
         WPSEO_Social_Admin::translate_meta_boxes();
     }
 }