Having trouble with how to filter the comment listing from WordPress back-end base on something else like user role?  Read this!

Sometime you might have custom role, let’s say co-editor, setup using members plugin in your WordPress.  And then you want to achieve  showing all comments only to the user who has administrator role but user with co-editor role sees only some of the comment.  You could use the below code to overcome this saturation.

Continue reading

Having trouble with how to filter the post listing from WordPress back-end base on something else like user role?  Read this!

Sometime you might have custom role, let’s say co-editor, setup using members plugin in your WordPress.  And then you want to achieve  showing all posts only to the user who has administrator role but user with co-editor role sees only some of the posts.  You could use the below code to overcome this saturation.
Continue reading

Today I am going to showing you how to add additional fields to WordPress back-end profile page.  Sometime you might need to add additional fields to the user profile page and you could use below code.

function add_more_profile_fields( $profileuser ) {
           //add your fields here
}

//call this action hook
add_action( 'show_user_profile', add_more_profile_fields );
add_action( 'edit_user_profile', add_more_profile_fields );

Continue reading

When you are working with html form, you might need this below javascript code to implement form reset and cancel features.

 <script type="text/javascript">
 function clearform(){
 if(confirm("Are you sure you want to reset the form?")){
 document.res_reg.reset();
 }
 }

function cancelAction() {
 var cancel=confirm("Are you sure you want to cancel?")
 if (cancel==true)
 {
 // Go back (Same result as pressing browser back button)
 history.go(-1);
 }
 else
 {
 <!-- nothing happens-->
 }
 }
 </script>
 <input type="button" value="Reset" onclick="clearform();return false" />
 <input type="button" value="Cancel" onclick="cancelAction();" />