Export User Info to CSV from Front End

Nevermind, I figured out a way to make it work. I just removed the need for a url altogether. Here’s what I did in case anybody else wants to know. I changed the link to an form input button: <form method=”post”> <input type=”submit” name=”bc_export” class=”btn btn-export” value=”Export Store List for ‘.$atts[‘value’].'” /> </form> And changed … Read more

Question about repurposing WordPress 404 handler

Here is the tested code, you can use it as a mu-plugin: <?php /** * Filters whether to short-circuit default header status handling. * * Returning a non-false value from the filter will short-circuit the handling * and return early. * * @param bool $preempt Whether to short-circuit default header status handling. Default false. * … Read more

WordPress will not operate correctly

You probably messed up with the config on the DB I would like the dump of the config table please, that way i can see the paths to your wp install (i had a similar problem which i solved by manually correcting the fields in DB) EDIT Run this sql query and let me know … Read more

Rewriting search and pagination base

there are 3 steps towards achieving your goal. 1 – Rewrite rules – wordpress needs to know what to look for and what to map it to add_rewrite_rule( ‘suche/([^/]+)/?$’, ‘index.php?s=$matches[1]’, ‘top’ ); add_rewrite_rule( ‘suche/([^/]+)(/seite/(\d+))/?$’, ‘index.php?s=$matches[1]&paged=$matches[3]’, ‘top’ ); The above adds straight rewrite rules to the rewrite rules array so anytime someone goes to a URL … Read more

Best way to extends core classes in theme?

What you are doing will work, and is correct as far as the PHP goes. Whether it is a good idea or not really depends on what you are doing specifically and whether you can do it with hooks— actions and filters– instead. If you can do it with hooks you probably should but your … Read more

Using Global Variables Expensive for PHP

Here is a basic class which you can create once: if ( ! class_exists(‘my_class’) ) : class my_class { public $my_var; // This variable is for a single instance static $instance; function __construct () { // Call other methods like this $this->initialize(); } function initialize () { // Populate your variables here $this->my_var=”any value you … Read more

Modify image while uploading

this is how I’ve done it preg_match(‘/\.[^\.]+$/i’,$file[‘file’][‘name’],$ext); $name = md5(time().$user_id.rand( 5, 97)); $name_one = $name.$ext[0]; $name_blur = $name.’_blur’.$ext[0]; $file[‘file’][‘name’] = $name_one; $upload = wp_upload_dir(); $uploaded_file = wp_handle_upload( $file[‘file’], array( ‘action’=> ‘bp_upload_profile_bg’ ) ); //if file was not uploaded correctly if ( !empty($uploaded_file[‘error’] ) ) { bp_core_add_message( sprintf( __( ‘Upload Failed! Error was: %s’, ‘buddypress’ ), … Read more