Plugin child folder?

You don’t, for the same reason you don’t modify WordPress Core, you extend it or use hooks and filters to modify its behaviour. So when extending or changing plugins you have 2 options: Forking You’ve been creating forks of a plugin so far, but it’s important to change the name when this happens so your … Read more

dequeue not work

Scripts should be enqueued on wp_enqueue_scripts action hook, which runs after init action. So dequeuing on init won’t work because sripts are not enqueued yet. Before enqueued scripts are printed, wp_print_scripts action is triggered so you can dequeue or unregister scripts safely at this moment: add_action( ‘wp_print_scripts’, ‘drw_timelinr_dequeue’ ); function drw_timelinr_dequeue () { wp_dequeue_script(‘jquery.timelinr’); } … Read more

do_action and hook methods

Your analogy here is partially correct, but incomplete: I understand that when do_action is called wp looks for all registered listeners and invokes them according set priority. You need to consider what happens when you call add_action. WordPress never searches for the add_action statements, it has those in a list. When you call add_action, it … Read more

How to add post_author column to custom post type

The $supports argument should include author for the Author settings to be available for the custom post type: ‘supports’ => array( ‘title’, ‘custom-fields’, ‘author’ ) ‘supports’ (array) Core feature(s) the post type supports. Serves as an alias for calling add_post_type_support() directly. Core features include ‘title’, ‘editor’, ‘comments’, ‘revisions’, ‘trackbacks’, ‘author’, ‘excerpt’, ‘page-attributes’, ‘thumbnail’, ‘custom-fields’, and … Read more

Get product attribute for Simple product in WooCommerce

Building on Loic’s answer for an attribute of pa_manufacturer: if ( get_post_type( $post ) === ‘product’ && ! is_a($product, ‘WC_Product’) ) { $product = wc_get_product( get_the_id() ); // Get the WC_Product Object } $product_attributes = $product->get_attributes(); // Get the product attributes // Output $manufacturer_id = $product_attributes[‘pa_manufacturer’][‘options’][‘0’]; // returns the ID of the term $manufacturer_name = … Read more