How to properly use a hook to create template for custom product type in a plugin such as Woocommerce? [closed]

You may use an action in the format woocommerce_YOUR_PRODUCT_TYPE_add_to_cart to reach the goal. Here is the example. The following code is for putting in functions.php, if you are writing a plugin. Please remember to change the callback. eg. you have a product type called Special, you want to add the add-to-cart template for it. add … Read more

WordPress 2.8 Widget API is suitable for Worpress 3.1.4 plugins development?

WordPress APIs usually refer to group of functions and concepts and are not versioned. Any versions refer to WP itself (or in some cases to bundled components, developed by third parties such as jQuery). In WordPress version 2.8 creating widgets was refactored from older code (which you shouldn’t care about) to newer class-based code (which … Read more

Help with callback using do_action_ref_array

That feature exists because I bugged them to implement it 🙂 https://support.booking-wp-plugin.com/hc/en-us/community/posts/207263389-Add-a-WordPress-hook-for-custom-validators-on-the-custom-fields?page=1#community_comment_115001021885 Using it confused me as well but somebody finally replied to this just the other day with this snippet: add_action( ‘bookly_validate_custom_field’, function ( \stdClass $field, &$errors, $cart_key, \stdClass $field_info ) { // Validation by custom_field id switch ( $field->id ) { case ‘id_value’: … Read more

How to alter the order of custom form fields

WordPress doesn’t provide the hooks you want but it you are willing to use PHP’s output buffering and preg_replace() you can get it to work without hacking core. Here’s an answer that talks about the general technique required: Removing Unnecessary Text from Admin Menu without CSS The hooks you’ll want to use are ‘category_pre_add_form’ for … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)