This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not include the opening php tag. | |
//* Do not trigger Jetpack Publicize if the post uses the 'status' post format. | |
add_filter( 'publicize_should_publicize_published_post', 'crt_control_publicize', 10, 2 ); | |
function crt_control_publicize( $should_publicize, $post ) { | |
// Return early if we don't have a post yet (it hasn't been saved as a draft) | |
if ( ! $post ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not include the opening php tag. | |
// Populate image title, alt-text, caption, and description on upload | |
add_action( 'add_attachment', 'crt_set_image_meta' ); | |
function crt_set_image_meta( $post_ID ) { | |
// Check if uploaded file is an image, else do nothing | |
if ( wp_attachment_is_image( $post_ID ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not include the opening php tag. | |
//* Change post title to date if no title is provided | |
add_filter( 'wp_insert_post_data', 'crt_update_blank_title' ); | |
function crt_update_blank_title( $data ) { | |
$title = $data['post_title']; | |
$post_type = $data['post_type']; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not include the opening php tag. | |
//* Remove status post format from main query unless page is the status archive or an admin screen | |
add_filter( 'pre_get_posts', 'crt_remove_status_format' ); | |
function crt_remove_status_format( $query ) { | |
if ( ! is_tax( 'post_format', 'post-format-status' ) && ! is_search() && ! is_admin() && ! ( defined ( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) ) { | |
$tax_query = array( array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not include the opening php tag. | |
//* Remove post titles in RSS feed for status posts | |
add_filter( 'the_title_rss', 'crt_change_feed_post_title' ); | |
function crt_change_feed_post_title( $title ) { | |
if ( has_post_format( 'status' ) ) { | |
$title = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.hidetitle .entry-title { | |
display:none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not include the opening php tag. | |
//* Remove post title for status posts | |
add_filter( 'post_class', 'crt_remove_status_post_titles' ); | |
function crt_remove_status_post_titles( $classes ) { | |
if ( has_post_format( 'status' ) ) { | |
$classes[] = 'hidetitle'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not include the opening php tag. | |
//* Add support for status post format | |
add_theme_support( ‘post-formats’, array( | |
‘status’, | |
) ); |