Changeset 2884250
- Timestamp:
- 03/21/2023 12:32:03 PM (3 years ago)
- Location:
- add-schema-category
- Files:
-
- 12 added
- 4 edited
-
tags/2.0.0 (added)
-
tags/2.0.0/add-schema-category.php (added)
-
tags/2.0.0/inc (added)
-
tags/2.0.0/inc/ATH-output.php (added)
-
tags/2.0.0/inc/ATH-save-schema.php (added)
-
tags/2.0.0/inc/index.php (added)
-
tags/2.0.0/lang (added)
-
tags/2.0.0/lang/ATH.pot (added)
-
tags/2.0.0/lang/fa_IR.mo (added)
-
tags/2.0.0/lang/fa_IR.po (added)
-
tags/2.0.0/lang/index.php (added)
-
tags/2.0.0/readme.txt (added)
-
trunk/add-schema-category.php (modified) (2 diffs)
-
trunk/inc/ATH-output.php (modified) (1 diff)
-
trunk/inc/ATH-save-schema.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
add-schema-category/trunk/add-schema-category.php
r2875874 r2884250 5 5 * Plugin URI: https://github.com/peymanath/Add-Schema-Category-Wordpress 6 6 * Description: Using this plugin you can add and manage Schema codes to the WordPress category. 7 * Version: 2. 0.07 * Version: 2.1.0 8 8 * Requires at least: 6.0.1 9 9 * Requires PHP: 7.4 … … 38 38 </th> 39 39 <td> 40 < textarea dir="ltr" name="peymanseo_add_schema_category_code" id="peymanseo_add-cat-schema" style="width:100%;" class="large-text" rows="7"><?= wp_kses($ATH_SCHEMA_DB, array('script' => array())); ?></textarea>40 <?php wp_editor(stripslashes($ATH_SCHEMA_DB), "peymanseo_add_schema_category_code", ['media_buttons' => false]); ?> 41 41 </td> 42 42 </tr> -
add-schema-category/trunk/inc/ATH-output.php
r2875874 r2884250 1 1 <?php defined('ABSPATH') || exit('No see'); 2 2 3 add_action('edited_category', 'ATH_SAVE_SCHEMA', 10, 2); 4 add_action('edited_product_cat', 'ATH_SAVE_SCHEMA', 10, 2); 3 function ATH_SCHEMA() 4 { 5 $get_peymanseo_schema_category = get_term_meta(get_queried_object_id(), 'peymanseo_schema_category', true); 6 echo wp_kses($get_peymanseo_schema_category, array('script' => array("type" => array()))); 7 } 5 8 6 function ATH_SAVE_SCHEMA($ID)9 function peymanseo_output_script_end_content($content) 7 10 { 11 return $content . get_term_meta(get_queried_object_id(), 'peymanseo_schema_category', true); 12 } 8 13 9 $ATH_POST_META_SCHEMA = wp_kses( 10 $_POST['peymanseo_add_schema_category_code'], 11 array('script' => array()) 12 ); 14 add_action('category_description', 'peymanseo_output_script_end_content'); 15 add_action('the_archive_description', 'peymanseo_output_script_end_content'); 13 16 14 if (strpos($ATH_POST_META_SCHEMA, 'schema.org') !== false) return; 17 if (!class_exists('WooCommerce')) { 15 18 16 if (isset($ATH_POST_META_SCHEMA) || $ATH_POST_META_SCHEMA !== " ") 17 update_term_meta($ID, 'peymanseo_schema_category', $ATH_POST_META_SCHEMA); 18 else 19 delete_term_meta($ID, 'peymanseo_schema_category'); 19 add_action('woocommerce_archive_description', function ($content) { 20 21 if (is_product_category()) 22 echo wp_kses(get_term_meta(get_queried_object_id(), 'peymanseo_schema_category', true), array('script' => array("type" => array()))); 23 }); 20 24 } -
add-schema-category/trunk/inc/ATH-save-schema.php
r2875874 r2884250 1 1 <?php defined('ABSPATH') || exit('No see'); 2 2 3 function ATH_SCHEMA() 3 add_action('edited_category', 'ATH_SAVE_SCHEMA', 10, 2); 4 add_action('edited_product_cat', 'ATH_SAVE_SCHEMA', 10, 2); 5 6 function ATH_SAVE_SCHEMA($term_id) 4 7 { 5 $get_peymanseo_schema_category = get_term_meta(get_queried_object_id(), 'peymanseo_schema_category', true); 6 echo wp_kses($get_peymanseo_schema_category, array('script' => array())); 8 $ATH_POST_META_SCHEMA = wp_kses($_POST['peymanseo_add_schema_category_code'], array('script' => array("type" => array()))); 9 10 if (isset($ATH_POST_META_SCHEMA)) 11 update_term_meta($term_id, 'peymanseo_schema_category', $ATH_POST_META_SCHEMA); 12 13 14 if ($ATH_POST_META_SCHEMA == '') 15 delete_term_meta($term_id, 'peymanseo_schema_category'); 16 elseif (strpos($ATH_POST_META_SCHEMA, 'schema.org') !== false) 17 return; 18 else 19 delete_term_meta($term_id, 'peymanseo_schema_category'); 7 20 } 8 9 function peymanseo_output_script_end_content($content)10 {11 return $content . get_term_meta(get_queried_object_id(), 'peymanseo_schema_category', true);12 }13 14 add_action('category_description', 'peymanseo_output_script_end_content');15 add_action('the_archive_description', 'peymanseo_output_script_end_content');16 17 if (!class_exists('WooCommerce')) {18 19 add_action('woocommerce_archive_description', function ($content) {20 21 if (is_product_category())22 echo wp_kses(get_term_meta(get_queried_object_id(), 'peymanseo_schema_category', true), array('script' => array()));23 24 });25 } -
add-schema-category/trunk/readme.txt
r2877760 r2884250 4 4 Requires at least: 7.4 5 5 Tested up to: 6.1 6 Stable tag: 2. 0.06 Stable tag: 2.1.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.