WP Customer Reviews – shortcodes

The plugin registrer some shortcodes in wp-custom-reviews.php: add_shortcode( ‘WPCR_INSERT’, array(&$this, ‘shortcode_wpcr_insert’) ); add_shortcode( ‘WPCR_SHOW’, array(&$this, ‘shortcode_wpcr_show’) ); Try: [WPCR_INSERT] and [WPCR_SHOW]

Advanced Custom Fields/User Role Editor – how to hide ACF for certain users?

The admin_menu action will hide the ACF menu, in this example for not-admins. And admin_head will block the access if the URL is accessed directly. E.g.: http://example.com/wp-admin/edit.php?post_type=acf and http://example.com/wp-admin/edit.php?post_type=acf&page=acf-settings add_action( ‘admin_menu’, ‘wpse_59032_remove_acf_menu’, 9999 ); add_action( ‘admin_head-edit.php’, ‘wpse_59032_block_acf_screens’ ); add_action( ‘admin_head-custom-fields_page_acf-settings’, ‘wpse_59032_block_acf_screens’ ); function wpse_59032_remove_acf_menu() { /* if not our allowed users, hide menu */ if … Read more

Display comments of users on single page

You can use the get_comments function to retrieve comments from a specific user. $comments = get_comments( array( ‘user_id’ => 1 ) ); foreach( $comments as $comment ) { $post_id = $comment->comment_post_ID; $post = get_post( $post_id ); setup_postdata( $post ); echo ‘<a href=”‘ . get_permalink() . ‘”>’ . get_the_title() . ‘</a>’; echo $comment->comment_author . ‘<br />’ … Read more

Where to place custom functions?

Organize your code by its purpose: If it creates output on the front end and requires changes in your theme’s style sheet – it belongs to the theme. You don’t have to put everything into the functions.php, split he code into several files if it helps. For example like this: // extra functions just for … Read more

Let user subscribe to specific categories

You can give them this url http://www.example.com/?cat=42&feed=rss2 This one if permalinks are enabled http://example.com/category/categoryname/feed Replace the site url & also the cateogries id or slug with the correct one UPDATE IN RESPONSE TO COMMENT Display a list of categories to the user maybe with wp_dropdown_categories. Save the id of the category the user subscribed to … Read more

Woocommerce with metabox plugin

Here’s the metabox code what I’m using which is working fine for me: // Add meta boxes with TinyMCE via wp_editor() function // Define the custom box add_action( ‘add_meta_boxes’, ‘product_details_add’ ); // Do something with the data entered add_action( ‘save_post’, ‘product_details_save’ ); // Adds a box to the main column on the Product post_type edit … Read more