Plugin Directory

Changeset 844234


Ignore:
Timestamp:
01/24/2014 12:35:53 AM (12 years ago)
Author:
LIJE
Message:

Bugfixes

Location:
auto-sticky-post
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • auto-sticky-post/tags/1.1.1/auto-sticky-post.php

    r844231 r844234  
    6969function jlasp_activation()
    7070{
    71     if( !get_option( 'jlasp_number_post' ) )
     71    if( (int)!get_option( 'jlasp_number_post' ) )
    7272    {
    7373        add_option( 'jlasp_number_post', 3 );
  • auto-sticky-post/tags/1.1.1/inc/functions.php

    r844231 r844234  
    1010 */
    1111function jlasp_set_featured_post( $number ) {
    12     $recent_posts = wp_list_pluck( wp_get_recent_posts($number), 'ID' );
    13     update_option( 'sticky_posts', $recent_posts);
     12    $recent_posts = wp_get_recent_posts($number);
     13    $new_sticky = array();
     14    foreach( $recent_posts as $recent ){
     15        array_push( $new_sticky, $recent["ID"]);
     16    }
     17    update_option( 'sticky_posts', $new_sticky);
    1418}
    1519
  • auto-sticky-post/trunk/auto-sticky-post.php

    r844231 r844234  
    6969function jlasp_activation()
    7070{
    71     if( !get_option( 'jlasp_number_post' ) )
     71    if( (int)!get_option( 'jlasp_number_post' ) )
    7272    {
    7373        add_option( 'jlasp_number_post', 3 );
  • auto-sticky-post/trunk/inc/functions.php

    r844231 r844234  
    1010 */
    1111function jlasp_set_featured_post( $number ) {
    12     $recent_posts = wp_list_pluck( wp_get_recent_posts($number), 'ID' );
    13     update_option( 'sticky_posts', $recent_posts);
     12    $recent_posts = wp_get_recent_posts($number);
     13    $new_sticky = array();
     14    foreach( $recent_posts as $recent ){
     15        array_push( $new_sticky, $recent["ID"]);
     16    }
     17    update_option( 'sticky_posts', $new_sticky);
    1418}
    1519
Note: See TracChangeset for help on using the changeset viewer.