Tag Info

Hot answers tagged

3

For do this you need to save in the db a value for remember that the alert was already showed. Else you can try to llok on that https://codex.wordpress.org/Function_Reference/register_activation_hook. With this you can execute an hook only on the activate action of the plugin.


2

Here is the fixed and modified code which was having the nonce action issue. <?php /* Plugin Name: Test Plugin Plugin URI: Test Description: Test Author: Test Version: 007 Author URI: */ // add all post types $clinical_post_types = array(); $post_types = get_post_types(); foreach ( $post_types as $post_type ) { $clinical_post_types[] = ...


2

Parse action: function angular_ajax_params_to_post() { $is_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX ); if($is_ajax){ $params = json_decode(file_get_contents('php://input'), true); foreach ($params as $param_key => $param_val) { $_POST[ $param_key ] = $param_val; } } } add_action( ...


1

Placing this answer for those people who're trying to fix the same issue. It's important where add_action('wp_ajax_setAsyncCheckProduct', [$this, 'setAsyncCheckProduct']); resides. In my case the issue was finally fixed moving a similar line to the main plugin file, where all concrete classes are included and initialised. Of course the line had to be ...


1

This is an issue with the creation of the nonce. wp_create_nonce( plugin_basename(__FILE__) ) . '/seo_fields.php" /> should probably be wp_create_nonce( plugin_basename(__FILE__) . '/seo_fields.php' ) . '" /> because otherwise !wp_verify_nonce($_POST['clinicalmeta_noncename'], plugin_basename(__FILE__).'/seo_fields.php') would not check for ...


1

Technically speaking, Woocommerce products are just another WordPress post object with a customized post type (which is product in this case). If you take a look at the create_product function inside class-wc-api-products.php, you'll see this line: // Attempts to create the new product $id = wp_insert_post( $new_product, true ); So the API ends up using ...


1

Turns out you have to have a <p> tag in the div to prevent that.


1

Here is a quick and dirty plugin that shows you how to achieve this (adapt this example to your own architecture and needs): <?php /* Plugin Name: Custom rewrite rule test */ add_action( 'plugins_loaded', array(Registration::get_instance(), 'setup') ); class Registration { protected static $instance = NULL; public function ...


1

By passing the _builtin argument to get_post_types(), only WordPress default post types will be returned. Instead, just pass public as an arguement, Here's an example of output on a development site with WooCommerce activated: var_dump(get_post_types(['public' => true])); //result array(4) { ["post"]=> string(4) "post" ["page"]=> ...



Only top voted, non community-wiki answers of a minimum length are eligible