JusticeTek Calendar

Settings‘;
array_unshift($links, $settings_link);
}

return $links;
}

function register_wop_settings() { // whitelist options
register_setting( ‘wop_options’, ‘wop_options_field’ );
}

/*——————————–
wop_options
——————————- */
function wop_plugin_options() {
?>

Widgets on Pages: Options

Need help with the Widgets on Pages plugin?

“;
$text .= “

Check out the documentation and support forums for help with this plugin.

“;
$text .= “Documentation
Support forums“;
}
return $text;
}

add_filter(‘contextual_help’, ‘wop_plugin_help’, 10, 3);

/* ===============================
C O R E C O D E
================================*/

// Main Function Code, to be included on themes
function widgets_on_template($id=”") {
if (!empty($id)) {
$sidebar_name = $id;
}
else {
$sidebar_name = ’1′;
}
$arr = array(id => $sidebar_name );
echo widgets_on_page($arr);
}

function widgets_on_page($atts){
reg_wop_sidebar();
extract(shortcode_atts( array(‘id’ => ’1′), $atts));
if (is_numeric($id)) :
$sidebar_name = ‘Widgets on Pages ‘ . $id;
else :
$sidebar_name = $id;
endif;
$str = “

    “;
    ob_start();
    if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar($sidebar_name) ) :
    endif;
    $myStr = ob_get_contents();
    ob_end_clean();
    $str .= $myStr;
    $str .= “

“;
return $str;
}

function reg_wop_sidebar() {
$options = get_option(‘wop_options_field’);
$num_sidebars = $options["num_of_wop_sidebars"] + 1;
// register the main sidebar
if ( function_exists(‘register_sidebar’) )
if ($options['wop_name_1'] != “”) :
$name = $options['wop_name_1'];
$sidebar_id = ‘ id=”‘ .$name . ‘”‘;
else :
$name = ‘Widgets on Pages 1′;
$sidebar_id = “”;
endif;
$id = ‘wop-1′;
//$sidebar_id = ‘wop-1′;
$desc = ‘#1 Widgets on Pages sidebar.
Use shortcode

    “‘;
    register_sidebar(array(
    ‘name’ => __( $name, ‘wop’ ),
    ‘id’ => $id ,
    ‘description’ => __( $desc, ‘wop’ ),
    ‘before_widget’ => ‘
  • ‘,
    ‘after_widget’ => ‘
  • ‘,
    ‘before_title’ => ‘

    ‘,
    ‘after_title’ => ‘

    ‘,
    ));

    // register any other additional sidebars
    if ($num_sidebars > 1) :
    for ( $sidebar = 2; $sidebar <= $num_sidebars; $sidebar++){ if ( function_exists('register_sidebar') ) $option_id = 'wop_name_' . $sidebar; if ($options[$option_id] != "") : $name = $options[$option_id]; $sidebar_id = ' id="' . $name . '"'; else : $name = 'Widgets on Pages ' . $sidebar; $sidebar_id = ' id=' . $sidebar; endif; //$sidebar_id = 'wop-' . $sidebar; $id = 'wop-' . $sidebar; $desc = '#' . $sidebar . 'Widgets on Pages sidebar. Use shortcode "[widgets_on_pages' . $sidebar_id .']"'; register_sidebar(array( 'name' => __( $name, ‘wop’ ),
    ‘id’ => $id ,
    ‘description’ => __( $desc, ‘wop’ ),
    ‘before_widget’ => ‘

  • ‘,
    ‘after_widget’ => ‘
  • ‘,
    ‘before_title’ => ‘

    ‘,
    ‘after_title’ => ‘

    ‘,
    ));
    }
    endif;
    }

    register_activation_hook(__FILE__,’wop_install’);

    add_action(‘admin_init’, ‘reg_wop_sidebar’);
    add_shortcode(‘widgets_on_pages’, ‘widgets_on_page’);

    /* ===============================
    A D D C S S ?
    ================================*/
    function add_wop_css_to_head()
    {
    echo “ “;
    }

    $options = get_option(‘wop_options_field’);
    $enable_css = $options["enable_css"];
    if ($enable_css) {
    add_action(‘wp_head’, ‘add_wop_css_to_head’);
    }

    ?>


    Comments & Responses

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Enable styling (remove bullets etc) ‘;
    ?>
    Number of additional sidebars WoP sidebar name:

    Rate this plugin

    If you like me, please rate me… or maybe even donate to the author

    or perhaps just spread the good word

    Mon Tue Wed Thu Fri Sat Sun
     
     12345
    6789101112
    13141516171819
    20212223242526
    27282930  

    Recent Posts

    Recent Comments

    Archives

    Categories

    Meta