Stop the execution of foreach loop which extract data from array?

It has probably more systematical solution, but one option is to save the highest recipient ID, and then load only higher IDs next time. Something like this: (not tested) $last_id = get_option(‘last_recipient_id’); $rcvr_id = $wpdb->get_results( $wpdb->prepare(“SELECT ID FROM wp_users WHERE ID > %d ORDER BY ID “), $last_id ) ; foreach($rcvr_id as $rv_id) { $rcvr_id … Read more

[jQuery]Adding shortcode

Seeing the form was for feedback purposes and not a lot was need I implemented a simple form of my own. jQuery: <form method=’post’ id=’feedback-form’>\ <textarea name=”feedback-message” id=’feedback-message’ rows=”10″ cols=”10″ required />\ <input type=”submit” name=”feedback-submit” id=’feedback-submit’ class=”ninja-forms-field btn btn-primary custom-button red-btn” value=”Thanks!” \ placeholder=”Type your comments/suggestions/functionality requests” />\ </form>\ PHP add_action( ‘init’, ‘feedback_form_submit’ ); function … Read more

Pagination in plugin’s backend

In the admin back-end of a plugin, you can’t use the query_vars hook and the get_query_var built in function since the page itself is a query parameter. To get around this, I simply add a new query parameter to the end of your plugin page link called, ‘&pagenum=#” and I pull it out manually using: … Read more

If no image, bigger text

This should work. <div class=”feature-section-1″> <?php $posts = get_posts( “tag=’tagtitle’&numberposts=1″ ); ?> <?php if( $posts ) : ?> <?php foreach( $posts as $post ) : setup_postdata( $post ); ?> <a href=”https://wordpress.stackexchange.com/questions/210837/<?php echo get_permalink($post->ID); ?>” > <?php if ( has_post_thumbnail() ): ?> <h3><?php echo $post->post_title; ?></h3> <div class=”false-excerpt-div”><?php the_excerpt(); ?></div> <?php the_post_thumbnail(‘columner-thumb’); ?> <?php else: ?> … Read more