How to automatically apply woocommerce product title to all product images alt tags?

This is what you need, taken from – https://stackoverflow.com/questions/27087772/how-can-i-change-meta-alt-and-title-in-catalog-thumbnail-product-thumbnail add_filter(‘wp_get_attachment_image_attributes’, ‘change_attachement_image_attributes’, 20, 2); function change_attachement_image_attributes( $attr, $attachment ){ // Get post parent $parent = get_post_field( ‘post_parent’, $attachment); // Get post type to check if it’s product $type = get_post_field( ‘post_type’, $parent); if( $type != ‘product’ ){ return $attr; } /// Get title $title = get_post_field( … Read more

Remove option to allow trackbacks/pingbacks from post page options

Your code is correct, AFAIK. It will disable the ability to do trackback/pings. It doesn’t remove that option from the screen, as you have noticed. Not sure how to test that, though. But your code should work to disable the actual process of allowing trackback/ping. This site might test trackback/pings https://tech.wizbangblog.com/ping.php . No experience with … Read more

How to call a PHP function from Javascript in WordPress

Here’s an example: Use this sample JavaScript code: jQuery(document).on(‘click’, ‘.some-element’, function(e){ var ipc = jQuery(this).data(‘collection-id’); jQuery(‘.some-other-element’).show(); jQuery.ajax({ method: ‘post’, url: ipAjaxVar.ajaxurl, data: { collection_id: ipc, action: ‘my_function’, } }).done(function(msg) { // Do something when done }); e.preventDefault(); }); PHP (include the function in your plugin, do not use a separate file): // Include the JavaScript … Read more

WSOD but WP_DEBUG not giving any errors

Make things simpler by using this in wp-config.php: define( ‘WP_DEBUG’, true ); /** debug on */ define( ‘WP_DEBUG_LOG’, true ); /** log enabled */ define( ‘WP_DEBUG_DISPLAY’, true); /** display enabled */ The @ini_set(‘display_errors’, 0); may be breaking the WP_DEBUG error display and logging by calling the native PHP error reporting at the same time.

How display widget by id

You can use wp_get_sidebars_widgets() with an “on demand” filter callback. This means we’re adding the filter callback, right before the call to the function and then remove right inside the callback again. This allows us, to use it only once. It also means, that we need to set it right before the call to wp_get_sidebars_widgets() … Read more

Check if post of title already exists

Yes $wpdb is built in and is loaded by the WordPress Core on every page load. I don’t see any critical problem with your code. I am going to suggest some improvements because I see some places where could go wrong, but mostly that should work. That makes me think that $article->heading is not matching … Read more

Is having multiple theme customizers for different pages possible?

This is not a complete solution and the code is not tested, but I it should be enough to give you a general idea of how to use the customizer for different pages. // Add “Edit page with customizer” link to relevant pages add_action(‘admin_bar_menu’, function($bar) { if (is_home()) { $bar->add_node(array( ‘id’ => ‘some-id-1’, ‘title’ => … Read more

Only Showing Upcoming Events

Hi @Spencer B.: Funny, my client submitted a bug ticket for the events modules I wrote for this very issue the other day, and I just fixed it a few hours ago. Note that my example uses a Custom Post Type of ‘event’ which is very useful to be able to differentiate logic for Events … Read more

Experiences with compiling WordPress using Hip Hop?

Original approach of static compilation in HipHop PHP-to-C++ has been since replaced by HipHop VM just-in-time compilation. Facebook prominently featured WordPress as example application and it no longer requires extensive (barely any by now) core edits. Old answer There is quite extensive presentation Rasmus Lerdorf – PHP Performance that uses WP as test subject and … Read more

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş