My first plugin doesn’t save the data in options

The problem is your validate function RSP_options_validate(). This function always a empty string. Check your conditional statement with preg_match. If you test your source without this functions, it works. register_setting( ‘RSP_options_group’, ‘RSP_options’, ‘RSP_options_validate’ ); to register_setting( ‘RSP_options_group’, ‘RSP_options’ );

Convert usernames listed by the Groups plugin shortcode to displayed names?

Bellow is the adapted function (by 24 rows shorter than the original), as was suggested by the commenters (many thanks!). It will work only if the Groups plugin was installed and activated. add_shortcode( ‘groups_group_info’, ‘groups_group_info’ ); function groups_group_info( $atts, $content = null ) { global $wpdb; $output = “”; $options = shortcode_atts( array( ‘group’ => … Read more

WordPress plugin not eching popular posts

one possibility is: public function popularPosts($num) { global $post; $args = array( ‘orderby’ => ‘comment_count’, ‘order’ => ‘DESC’ ); $posts = get_posts( $args ); $count = 0; foreach ($posts as $post): if($post->comment_count != 0 ){ $count++; } endforeach; if ( $count > 0 ): foreach( $posts as $post ) : setup_postdata($post); if($post->comment_count != 0 ){ … Read more

How can I add the custom taxonomy categories to the posts and pages?

All what you need to do is just pass required post types as array in the second parameter for register_taxonomy function call: add_action( ‘init’, ‘wpse8170_init’ ); function wpse8170_init() { register_taxonomy( ‘my-taxonomy’, array( ‘post’ ), array( … ) ); // or call this function if your taxonomy is already registered register_taxonomy_for_object_type( ‘my-taxonomy’, ‘page’ ); }