Changeset 6353 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
- Timestamp:
- 01/11/2018 10:26:59 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r6287 r6353 519 519 add_filter( 'the_content', array( $this, 'translate_post_content' ), 1, 2 ); 520 520 add_filter( 'the_title', array( $this, 'translate_post_title' ), 1, 2 ); 521 add_filter( 'single_post_title', array( $this, 'translate_post_title' ), 1, 2 ); 521 522 add_filter( 'get_the_excerpt', array( $this, 'translate_post_excerpt' ), 1, 2 ); 522 523 … … 916 917 */ 917 918 public function translate_post_title( $title, $post_id = null ) { 918 $post = get_post( );919 920 if ( $post instanceof \WP_Post && $post_id === $post->ID) {919 $post = get_post( $post_id ); 920 921 if ( $post instanceof \WP_Post ) { 921 922 $title = Plugin_I18n::instance()->translate( 'title', $title, [ 'post_id' => $post ] ); 922 923 }
Note: See TracChangeset
for help on using the changeset viewer.