Changeset 2563141
- Timestamp:
- 07/13/2021 01:11:28 AM (5 years ago)
- Location:
- iaf-headertags/trunk
- Files:
-
- 4 edited
-
iaf-headertags.php (modified) (1 diff)
-
inc/activate.php (modified) (1 diff)
-
inc/header.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
iaf-headertags/trunk/iaf-headertags.php
r2518605 r2563141 5 5 * Author: Fotso Fonkam 6 6 * Author URI: http://www.iamfotso.cm 7 * Version: 1. 07 * Version: 1.1 8 8 * Licence: GLP2+ 9 * Keywords: description, tag, seo, header, keyworks, optimisation, search, engine 9 * Keywords: description, tag, seo, header, keyworks, optimisation, search, engine, custom post types, cpt 10 10 * Text Domain: headertags 11 11 */ -
iaf-headertags/trunk/inc/activate.php
r2518605 r2563141 2 2 function iaf_headertags_activate (){ 3 3 // Verify WordPress version 4 if( version_compare( get_bloginfo( 'version' ), ' 4.4', '<' ) ){4 if( version_compare( get_bloginfo( 'version' ), '5.0', '<' ) ){ 5 5 wp_die( __( 'You must update your WordPress version before you can use this plugin.', 'headertags' ) ); 6 6 } -
iaf-headertags/trunk/inc/header.php
r2518605 r2563141 4 4 5 5 // Get options 6 $iaf_headertags_opts = get_option( 'iaf-headertags-opts' );6 $iaf_headertags_opts = get_option( 'iaf-headertags-opts' ); 7 7 8 8 // Get article meta-tag 9 $iaf_headertags_meta_description = get_post_meta( $post->ID, '_iaf_headertags_description', true ); 10 $iaf_headertags_meta_keywords = get_post_meta( $post->ID, '_iaf_headertags_keywords', true ); 9 $iaf_headertags_meta_description = get_post_meta( $post->ID, '_iaf_headertags_description', true ); 10 $iaf_headertags_meta_keywords = get_post_meta( $post->ID, '_iaf_headertags_keywords', true ); 11 12 // if archives or homepage, exit 13 if( is_archive() or is_home() ) { 14 return; 15 } 11 16 12 17 // If article is a post and manual mode is activated 13 18 if( 'post' == get_post_type() && $iaf_headertags_opts['post_tags'] == 'auto' ) { 14 19 $tags = get_the_tags(); 20 $cats = get_the_category(); 21 22 var_dump( $cats ); 15 23 16 24 $iaf_headertags_meta_description = get_the_excerpt(); 17 25 $iaf_headertags_meta_keywords = ''; 18 foreach( $tags as $tag ) { 19 $iaf_headertags_meta_keywords .= $tag->name . ', '; 26 27 // Article has no tags 28 if( !$tags ) { 29 foreach( $cats as $cat ) { 30 $iaf_headertags_meta_keywords .= $cat->name . ', '; 31 } 32 } else { 33 foreach( $tags as $tag ) { 34 $iaf_headertags_meta_keywords .= $tag->name . ', '; 35 } 20 36 } 21 37 -
iaf-headertags/trunk/readme.txt
r2518605 r2563141 2 2 Contributors: willfonkam 3 3 Tags: description, tag, seo, header, keyworks, optimisation, search, engine 4 Requires at least: 4.95 Tested up to: 5.7. 16 Stable tag: 1. 04 Requires at least: 5.0 5 Tested up to: 5.7.2 6 Stable tag: 1.1 7 7 License: GPL2+ 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 27 27 = 1.0 = 28 28 * Initial release. 29 30 = 1.1 = 31 * Added feature: if post has no tag, categoreies will be used as default keywords
Note: See TracChangeset
for help on using the changeset viewer.