Changeset 2098227
- Timestamp:
- 05/31/2019 12:47:18 AM (7 years ago)
- Location:
- title-remover
- Files:
-
- 3 added
- 2 edited
-
tags/1.2.1 (added)
-
tags/1.2.1/readme.txt (added)
-
tags/1.2.1/title-remover.php (added)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/title-remover.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
title-remover/trunk/readme.txt
r2090863 r2098227 4 4 Donate link: http://wpgurus.net/title-remover/ 5 5 Requires at least: 2.5 6 Tested up to: 5.2 7 Stable tag: 1.2 6 Tested up to: 5.2.1 7 Stable tag: 1.2.1 8 8 License: License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 29 29 30 30 == Changelog == 31 = 1.0 = 32 * Initial release 31 = 1.2.1 = 32 * Made plugin strings translatable 33 * Fixed typos in code 34 35 = 1.2 = 36 * Fixed the warnings that are displayed on some websites. 33 37 34 38 = 1.1 = … … 36 40 * Added new graphics for WP.org 37 41 38 = 1. 2=39 * Fixed the warnings that are displayed on some websites.42 = 1.0 = 43 * Initial release -
title-remover/trunk/title-remover.php
r1866904 r2098227 4 4 Plugin URI: http://wpgurus.net/title-remover/ 5 5 Description: Gives you the ability to hide the title of any post, page or custom post type item without affecting menus or titles in the admin area. 6 Version: 1.2 6 Version: 1.2.1 7 7 Author: WPGurus 8 8 Author URI: http://wpgurus.net/ … … 10 10 */ 11 11 12 /*-------------------------------------------------- 13 Hide Title 14 ----------------------------------------------------*/ 12 /** 13 * Load plugin text domain 14 */ 15 function wptr_load_plugin_textdomain() { 16 load_plugin_textdomain( 17 'title-remover', false, 18 dirname( plugin_basename( __FILE__ ) ) . '/languages' 19 ); 20 } 15 21 16 function wptr_supress_title( $title, $post_id = 0 ) { 22 add_action( 'plugins_loaded', 'wptr_load_plugin_textdomain' ); 23 24 /** 25 * Filter the title and return empty string if necessary. 26 * 27 * @param $title string The old title 28 * @param int $post_id The post ID 29 * 30 * @return string Old title or empty string. 31 */ 32 function wptr_suppress_title( $title, $post_id = 0 ) { 17 33 if ( ! $post_id ) { 18 34 return $title; … … 27 43 } 28 44 29 add_filter( 'the_title', 'wptr_sup ress_title', 10, 2 );45 add_filter( 'the_title', 'wptr_suppress_title', 10, 2 ); 30 46 31 47 /*-------------------------------------------------- … … 46 62 function wptr_add_post_meta_boxes() { 47 63 add_meta_box( 48 'wptr-hide-title', // Unique ID49 'Hide Title?', // Title50 'wptr_render_metabox', // Callback function51 null, // Admin page52 'side', // Context53 'core' // Priority64 'wptr-hide-title', 65 esc_html__( 'Hide Title?', 'title-remover' ), 66 'wptr_render_metabox', 67 null, 68 'side', 69 'core' 54 70 ); 55 71 } … … 62 78 <input type="checkbox" name="wptr-hide-title-checkbox" id="wptr-hide-title-checkbox" 63 79 value="1" <?php checked( $curr_value, '1' ); ?> /> 64 <label for="wptr-hide-title-checkbox"> Hide the title for this item</label>80 <label for="wptr-hide-title-checkbox"><?php esc_html_e( 'Hide the title for this item', 'title-remover' ); ?></label> 65 81 <?php 66 82 }
Note: See TracChangeset
for help on using the changeset viewer.