How to pass parameters in wordpress shortcode?

As the docs for add_shortcode() state, Every shortcode callback is passed three parameters by default, including an array of attributes ($atts), the shortcode content or null if not set ($content), and finally the shortcode tag itself ($shortcode_tag), in that order. Use the shortcode_atts() to define what attributes are allowed and set default values for those … Read more

Automatically register users with comments

There are a number of functions you can use: register_new_user wp_create_user wp_insert_user The first function being the most simple to use and the last function gives you many more options – it depends what you want to do. You can create the new account when the comment is posted using the comment_post hook. You will … Read more

How to change the comments form title based on post type

You can use the comment_form_defaults filter to change your text based on custom post type. Just check the post type in your filter function. For example: add_filter( ‘comment_form_defaults’, ‘my_comment_form_defaults’ ); function my_comment_form_defaults( $defaults ) { if ( ‘my_cool_custom_post_type’ == get_post_type() ) { $defaults[‘title_reply’] == ‘My Custom Post Type Comment Title’; } return $defaults; } If … Read more