WordPress PHP plugin – Settings page error

Your form is not including any additional parameters. $_SERVER[‘PHP_SELF’] is only the file name, not the ?page=job-board/adduser.php part. The script is going precisely where you are telling it to go. You need to alter your form to push those values though. You need to include that GET component into the action attribute. But give your … Read more

Adding rich text editor to my plugin

wp_editor() outputs the textarea(html codes), so, maybe you dont need to use that in functions.php, but use inside the page’s source. (for example, in your plugin.php: <div class=”blabla> <form action=”” method=”POST”> <?php wp_editor( ‘Hi,its content’ , ‘desired_id_of_textarea’, $settings = array(‘textarea_name’=>’your_desired_name_for_$POST’) ); ?> <input type=”submit”> </form> </div> note: it may wont work for add_option function..

Add agenda items and notifications

The WordPress way to organize this is to create separate post types for the tournaments, the games, and the participants. Here is an example for the tournament post type registration: add_action( ‘wp_loaded’, function() { register_post_type( ‘tournament’, [ ‘label’ => __( ‘Tournaments’, ‘tournaments’ ), ‘labels’ => [ ‘name’ => __( ‘Tournaments’, ‘tournaments’ ), ‘singular_name’ => __( … Read more

How does WooCommerce display a custom comment_type in Comment Admin?

To answer your first question: »How does WooCommerce add the comment_type of order_note to the dropdown in Comment Administration?«. From woocommerce-admin-init.php: function woocommerce_admin_comment_types_dropdown( $types ) { $types[‘order_note’] = __( ‘Order notes’, ‘woocommerce’ ); return $types; } add_filter( ‘admin_comment_types_dropdown’, ‘woocommerce_admin_comment_types_dropdown’ ); Of course you have to do your own, to avoid conflicts, like this: add_filter( ‘admin_comment_types_dropdown’, … Read more

woocomerce variations [closed]

Just to clarify, there is no limit to 50 variations for one product in Woocommerce – this is a big misunderstanding. You certainly can have way more variations than that. I have done it myself numerous times and never had a problem. For a overview concerning variations take a look at the woocommerce documentation: Product … Read more

Plugin to install a plugin

You can take a look at TGM-Plugin-Activation plugin. It should give you good starting point. As written in the documentation: TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install and even automatically activate plugins in singular … Read more

Restricting users to a specific front end page [closed]

You’d have to add a function during the init action of WP. There you’ll get the current user and check whether they have a specific role assigned to them and redirect to the page when they do. add_action(‘init’, function () { $user = wp_get_current_user(); $role=”your role”; if (in_array($role, $user->roles)) { wp_redirect(‘url’); } }); WordPress Function … Read more

How to add nofollow on all external links without plugin?

This is how I would do it : 1/ create a filter to access the post content before it’s displayed on page. See http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2/ Inside your fonction called (ie : my_the_content_filter in the example from the Codex) adapt this code : https://stackoverflow.com/questions/5037592/how-to-add-rel-nofollow-to-links-with-preg-replace Cheers !