adding a text message beside the comment submit button

You should not edit the WordPress core files! If you have comment_id_fields() in your comments template, like this: <p class=”form-submit”> <input name=”submit” type=”submit” id=”<?php echo esc_attr( $args[‘id_submit’] ); ?>” value=”<?php echo esc_attr( $args[‘label_submit’] ); ?>” /> <?php comment_id_fields( $post_id ); ?> </p> you might use: add_filter(“comment_id_fields”,”my_submit_comment_message”); function my_submit_comment_message($result){ return $result.” <span>(your message will only be … Read more

Woocommerce “out of stock” message [closed]

To override the default “out of stock” message that is being outputted as a <p> tag, copy: wp-content/plugins/woocommerce/templates/single-product/add-to-cart/simple.php to wp-content/themes/yourtheme/woocommerce/single-product/add-to-cart/simple.php See edit Woocommerce template files Open the copied file. On line 17 to 23 you find this code: <?php // Availability $availability = $product->get_availability(); if ($availability[‘availability’]) : echo apply_filters( ‘woocommerce_stock_html’, ‘<p class=”stock ‘ . esc_attr( … Read more

Is it possible to make shortcodes NOT case sensitive?

Here is another simple idea for a case-insensitive shortcode: /** * Make a shortcode case insensitive via the the_content filter * * @param string $content * @return string $content */ function my_case_insensitive_shortcode( $content ) { $sc=”test”; // Edit this shortcode name to your needs $from = ‘[‘. $sc ; $to = $from; if( stristr( $content, … Read more

woocommerce product attributes

A look at the documentation or the source is always helpful. I guess, the correct file to refer to would have been product-attributes.php. For getting the product attributes this is available: get_attribute() ; to list them list_attributes() can be used, which makes use of the product-attributes.php template. You can use those and then hook into … Read more

How to get list of Scripts in Order of Dependencies

All the information you need you can get from the global variable $wp_scripts: Code: function wpse124227_wp_script_styles_debug_basic() { global $wp_scripts, $wp_styles; echo ‘<pre>’; //Scripts print_r( $wp_scripts ); //Styles //print_r( $wp_styles ); echo ‘</pre>’; } add_filter( ‘wp_head’, ‘wpse124227_wp_script_styles_debug_basic’ ); To get a more specific output you have to define what you are looking for, instead of printing … Read more