Last active
May 19, 2017 20:57
-
-
Save k4zuki02h4t4/f8b8958bc4f6550b388887a3ab3204a5 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* BAPT - Add MW WP Form save data button. | |
* | |
* @param $post_type | |
*/ | |
function bapt_add_mwwpform_save_data_button( $post_type ) { | |
if ( 'mw-wp-form' !== $post_type || ! class_exists( 'MW_WP_Form_Contact_Data_Setting' ) ) { | |
return; | |
} | |
$contact_data_post_types = MW_WP_Form_Contact_Data_Setting::get_posts(); | |
if ( empty( $contact_data_post_types ) ) { | |
return; | |
} | |
?> | |
<div class="bapt-content-actions"> | |
<h4><?php esc_html_e( 'Inquiry data', 'mw-wp-form' ); ?></h4> | |
<div class="bapt-content-actions__links"> | |
<a class="page-title-action post-type-button view-all" href="<?php echo esc_url( admin_url( 'edit.php?post_type=mw-wp-form&page=mw-wp-form-save-data' ) ); ?>"><?php esc_html_e( 'View All', 'better-admin-post-types' ); ?></a> | |
</div> | |
</div> | |
<?php | |
} | |
add_action( 'bapt_before_post_type_taxonomy_buttons', 'bapt_add_mwwpform_save_data_button' ); |
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 | |
/** | |
* BAPT - Exclude mw-wp-form. | |
* | |
* @param $post_types | |
* | |
* @return mixed | |
*/ | |
function bapt_exclude_mwwpform( $post_types ) { | |
unset( $post_types['mw-wp-form'] ); | |
return $post_types; | |
} | |
add_filter( 'bapt_content_submenu_post_types', 'bapt_exclude_mwwpform' ); | |
add_filter( 'bapt_removed_admin_menus', 'bapt_exclude_mwwpform' ); | |
add_filter( 'bapt_content_page_post_types', 'bapt_exclude_mwwpform' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment