Constraints in custom tables for plugin development – Yes or No?
Constraints in custom tables for plugin development – Yes or No?
Constraints in custom tables for plugin development – Yes or No?
In case someone encounters this exact problem in the future: I found the error to be related to the external api not being properly configured to handle a request to a secure endpoint. Since my site on WPEngine is secure (https), IIS needs to be configured to handle TLS1.2, which is wasn’t (start here for … Read more
All you have to do is to escape it correctly. In your code you escape the excerpt using esc_html, but you put it in the attribute – so it isn’t secure and it can break your site. You should use esc_attr to escape attributes. Then you can put content too: data-content=”<?php echo esc_attr( get_the_content() ); … Read more
Okay. I solved the problem myself. I was not populating the the array of a meta_key the correct way. Below, you will find a working solution: $check_post_exists = function( $title ) use ( $wpdb, $postTypeArray ) { // Get an array of all posts within our custom post type $posts = $wpdb->get_col( “SELECT post_title FROM … Read more
How to output CMB2 select options from repeated groups select elements?
Although this is possible, you really don’t want to load multiple versions of libraries as it’s going to make your site slow to load. You could try and use Bootstrap with a pre-processor like SASS with mixins to target just your plugin code and not the rest of the theme. FontAwesome 4 and 5 seem … Read more
How to extend WooCommerce API to show bookable product availability rules?
You’re almost there… If you have this in your plugin: function sp_echo_site() { echo get_site_url(); } Then you call this function as this: sp_echo_site(); And this line will run this function in the context of current site. So you’ll have to do something like this: if ( function_exists( ‘get_sites’ ) ) { foreach ( get_sites() … Read more
Addition of custom option panel crashes Media Library & Admin Area
You’re very close. When you add your first submenu page you want to duplicate your initial menu page. In your second add_submenu_page you are missing the function callback for that page. Technically this parameter is optional, but it changes your url from /wp-admin/sub-menu-page to /wp-admin/admin.php?page=sub-menu-page. Give this a shot: add_action( ‘admin_menu’, ‘my_menu_pages’ ); function my_menu_pages() … Read more