How I fixed: “Uncaught TypeError: Object [object Object] has no method tablesorter”

/Camp — Free classes on all things Web in the Scottsdale, Arizona area (Ad)


Trying to get this Tablesorter plugin to work I did the following to fix it:

Okay, so this is what I did to fix this. First, I noticed that the plugin extends the $ functions, so I had to make sure and use (right way)

$(document).ready(function() { 
    $('#report').tablesorter(); 
});

Before, I was using this because I was using WordPress (wrong way)

jQuery(document).ready(function() { 
    jQuery('#report').tablesorter(); 
});

Then, I had to make sure that in they weren’t <td>‘s, but were <th>‘s

<table class="tablesorter" id="report">
        <thead>
            <tr class="head">
                <th class="id">ID</th>
                <?php foreach($definitions['report_fields'] as $field_key): ?>
                    <th>
                        <?php webfoots_e($definitions['fields'][$field_key]['label']); ?>
                    </th>
                <?php endforeach; ?>
            </tr>
        </thead>

Hope it helps!

Over @Stackoverflow

XAMPP Sendmail using Gmail account

This is how I did it:

Okay, today, the best answer did not work for me. But, this did:

in sendmail.ini:

[sendmail]
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=****@gmail.com
auth_password=*******
force_sender=****@gmail.com

in php.ini:

[mail function]
sendmail_path = ""C:xamppsendmailsendmail.exe" -t"

Based on port @: http://support.google.com/mail/bin/answer.py?hl=en&answer=13287

@http://stackoverflow.com/a/11020314/1436129

WordPress Change Default Display Name Publicy As for all existing users

<?php

//Sets the user's display name (always) to first name last name, when it's avail.
add_action ('admin_head','make_display_name_f_name_last_name');
function make_display_name_f_name_last_name(){

    $users = get_users(array('fields'=>'all'));

    foreach($users as $user){
        $user = get_userdata($user->ID);    

        $display_name = $user->first_name . " " . $user->last_name;

        if($display_name!=' ') wp_update_user( array ('ID' => $user->ID, 'display_name' => $display_name) );
            else wp_update_user( array ('ID' => $user->ID, 'display_name' => $user->display_login) );

        if($user->display_name == '')
            wp_update_user( array ('ID' => $user->ID, 'display_name' => $user->display_login) );
    }
}

?>

From: WordPress Change Default Display Name Publicy As for all existing users

How to filter / exclude posts by id in list of posts in WordPress Dashboard / Admin

Okay, so I’ve answered my own question. Here is some code on how I did it.

function exclude_list_per_function( $query ) {

    global $wpdb;

//gets all the post ID's, I know this is a bit of a hack
    $querystr = "
        SELECT $wpdb->posts.ID
        FROM $wpdb->posts
    "; $post_ids = $wpdb->get_results($querystr, OBJECT);

        //Go through each post and pass it to a function that returns true if the user_can, and false if the user_can't
        foreach($post_ids as $post_obj){
            if(!can_user_other_function_view_this_post(get_post($post_obj->ID))){
                //if they_can't, add them to the array to be excluded
                $posts_not_in[]=$post_obj->ID;
            }
        }

        //Set those posts to be excluded from the list.
        if(is_array($posts_not_in)) $query->set( 'post__not_in', array_merge($query->get('post__not_in'), $posts_not_in) );
}

add_action( 'pre_get_posts', 'exclude_list_per_function');

From How to filter / exclude posts by id in list of posts in WordPress Dashboard / Admin