Having Problem On Getting WP Post Gallery Images URL

As I’ve explained elsewhere, you can modify the image sizes of the get_post_gallery() or get_post_gallery_images() with a simple filter: // Add a filter for full gallery size: add_filter( ‘shortcode_atts_gallery’,’wpse_full_size_gallery’ ); $gallery = get_post_gallery( get_the_ID(), false ); // Remove the filter: remove_filter( ‘shortcode_atts_gallery’,’wpse_full_size_gallery’ ); where: function wpse_full_size_gallery( $out ) { $out[‘size’] = ‘full’; // Edit this … Read more

OEmbed from Pinterest

I found that https://wordpress.org/plugins/pinterest-widgets actually has the needed functionality but doesn’t mention it in the description. After installing and activating you can add a pinboard to a post by using the following shortcodes [pin_board url=”http://www.pinterest.com/pinterest/pin-pets/”] [pin_board url=”http://www.pinterest.com/pinterest/pin-pets/” size=”header”] [pin_board url=”http://www.pinterest.com/pinterest/pin-pets/” size=”custom” image_width=”100″ board_width=”900″ board_height=”450″] more options can be found on the plugins “settings” page after … Read more

Plugin development: how to create a form and get custom data?

The details of processing form data is specific to PHP therefore I will not go into it. The WordPress-specific part is that you want your code to be run on the ‘init’ event in order to have access to WordPress functions and globals (such as the users permissions). <?php add_action(‘init’, function(){ $reservation_capacity = sanitize_text_field( $_POST[‘reservation_capacity’] … Read more

How do I configure WordPress to talk to a Microsoft SQL Server database?

I think there is a new approach to it: https://blogs.msdn.microsoft.com/brian_swan/2010/05/12/running-wordpress-on-sql-server/ You can also use a 3rd party version of WordPress (not my cup of tea, by the way): https://code.google.com/archive/p/wordpress-mssql/ https://github.com/ProjectNami/projectnami Or follow this guide, but it might be a bit old: https://blog.building-blocks.com/installing-wordpress-on-windows-using-sql-server-2008-r2-part-1/ In the end I think the first link would be the best approach. … Read more

add_meta_boxes action with refresh on save

So I managed to cobble something together with a bit of javascript… It’s hacky but somewhat elegant I think. add_action(‘admin_init’, function () { if ( current_user_can(“send_notifications”) ) { $post_types = [“post”, “go_live”]; foreach ($post_types as $post_type) { add_meta_box( ‘cabtv_notif_on_post’, ‘Notifications’, function ($post) { wp_nonce_field( ‘cabtv_notif_metabox’, ‘cabtv_notif_metabox’ ); $sent = (bool) get_post_meta( $post->ID, ‘cabtv_notifications_sent’, true ); … Read more