Simulate Update User button click

Thanks must go to WebElaine as her comment lead me on the right path to solving this. The issue was when the pmprommpu_addMembershipLevel() adds the membership level it sets the endate to 0000-00-00 00:00:00 running a $wpdb->update to set this to NULL fixed the problem.

WP Plugin permissions – create new files

I can think here of two possibillites. Use the wp-content/uploads maybe for your text-file because the file permission restriction are more or less bypassed in this directory. Put all stuff to wp_options and write a page Template imitating the text-file like page_text.php /* Template Name: Text-Template */ echo get_option(‘ads’, false); Create a page and asign … Read more

{status}_{post_type} does not run correctly?

WooCommerce has its own hooks for things like this. You shouldn’t rely on the underlying WordPress post-related hooks and functions when dealing with products and orders. WooCommerce is moving towards using custom database tables for products and orders instead of custom post types and while there’ll be hooks etc. added for backwards compatibility, you’ll be … Read more

catch urls with specific pattern and show specific content for them by plugin

There might be other ways, but what I would so is create a rewrite rule in your .htaccess file, something like: RewriteRule ^items/([0-9]*) /items/?page=$1 Now your user sees: http://mywordpress_site.com/items/1/ But behind the scenes, your site sees: http://mywordpress_site.com/items/?page=1 Then in your shortcode: $page = (int) $_GET[‘page’]; WP has tools in it to manage rewrites, and it … Read more

register_activation_hook not creating table

You create auto column sno int(10) NOT NULL AUTO_INCREMENT, and forget to define it as key, add PRIMARY KEY (sno) to your sql. $sql = “CREATE TABLE $table_name ( sno int(10) NOT NULL AUTO_INCREMENT, postid int(50) NOT NULL, subpostid varchar(5) NOT NULL, votingcount varchar(50) NOT NULL, postclicktime timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (sno) … Read more