Is it possible to filter the display name for post formats for display in the Formats meta box?

Yes, you can. You can hook right into gettext. The example provided below changes Publish button: add_filter( ‘gettext’, ‘binda_change_publish_button’, 10, 2 ); function binda_change_publish_button( $translation, $text ) { //check if this is pizza add or edit page in administration global $pagenow, $typenow; if ( is_admin() && ( $pagenow == ‘post-new.php’ or $pagenow == ‘post.php’ ) … Read more

Add additional field to custom post_type

In your code, you are using: add_filter( ‘team_Meta_Box’, ‘team_sample_metaboxes’ ); On the site you linked to, they are using: add_filter( ‘cmb_meta_boxes’, ‘wpb_sample_metaboxes’ ); So my question is: did you change all instances of “cmb” to “team” in the init.php file? If you did, then the correct filter to use should be: add_filter( ‘team_meta_boxes’, ‘team_sample_metaboxes’ ); … Read more

Settings API – save multiple tabs at once

Don’t initialize defaults, or do an initial save. Just use sane defaults. For example, define an array of defaults: function wpse92323_get_option_defaults() { $defaults = array( ‘slug1’ => ‘default1’, ‘slug2’ => ‘default2’ ); return apply_filters( ‘wpse92323_option_defaults’, $defaults ); } Then, write a function to return an option value, that parses stored options against your defaults: function … Read more

Single page not working for custom post type

Add this to your functions.php: /* Flush rewrite rules for custom post types. */ add_action( ‘after_switch_theme’, ‘bt_flush_rewrite_rules’ ); /* Flush your rewrite rules */ function bt_flush_rewrite_rules() { flush_rewrite_rules(); } Then change your theme to a different theme and then set it back again to your custom theme. This will flush the rewrite rule and making … Read more

How can I add a filter to a particular post format?

Use get_post_format(): function test_filter($content) { $format = get_post_format(); if ( ! $format ) return $content; if ( ‘audio’ === $format ) // do something with audio if ( ‘aside’ === $format ) // do something with aside return “$content <hr>post format: $format”; } Since the_content() requires a global $post object to work, get_post_format() will always … Read more

Custom post type isn’t working

One problem is that your ‘capability_type’ parameter ‘community’ doesn’t match your ‘capabilities’ array values. From the Codex: capability_type (string or array) (optional) The string to use to build the read, edit, and delete capabilities. May be passed as an array to allow for alternative plurals when using this argument as a base to construct the … Read more