Closed angelyarmas closed 7 years ago
I updated the readme example. Please try again with that updated example.
i got this error now,
for this section
/**
* Callback dictates that shortcode button will only display if we're on a 'page' edit screen
*
* @return bool Expects a boolean value
*/
function shortcode_button_only_pages() {
if ( ! is_admin() ) {
return false;
}
$current_screen = get_current_screen();
if ( ! isset( $current_screen->parent_base ) || $current_screen->parent_base != 'edit' ) {
return false;
}
if ( ! isset( $current_screen->post_type ) || $current_screen->post_type != 'page' ) {
return false;
}
// Ok, guess we're on a 'page' edit screen
return true;
}
ha, ok, just updated the example again. :)
Thanks man, that fixes it.
Using the example code in the main page i got an error
Class 'Shortcode_Button' not found in C:\wamp\www\wordpress\wp-content\plugins\shortcode-test\shortcode-test.php
it seems that the problem is related to the loader class.
$button = new Shortcode_Button( $button_slug, $js_button_data, $additional_args );
i'm using the latest wordpress and CMB2 versions in a new wordpress enviroment.