Plugin Directory

Changeset 1242718


Ignore:
Timestamp:
09/10/2015 06:58:54 PM (11 years ago)
Author:
Studiofreya
Message:

Language support added

Location:
sf-category-menu/trunk
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • sf-category-menu/trunk/sf-category-menu.php

    r1167414 r1242718  
    55 * Plugin URI: http://studiofreya.com/sf-category-menu/
    66 * Description: Easy treeview menu for WordPress categories.
    7  * Version: 1.1
     7 * Version: 1.2
    88 * Author: Studiofreya AS
    99 * Author URI: http://studiofreya.com
     
    1111 */
    1212
    13 function getPostCount($catid)
     13function sf_getPostCount($catid)
    1414{
    1515$args = array(
     
    6666}
    6767
    68 function doCategories( $categories, $select_style, $parent = 0 )
     68function sf_doCategories( $categories, $select_style, $parent = 0 )
    6969{
    7070    $num = count( $categories );
     
    8787    {       
    8888        $ID = $category->cat_ID;
    89         $subcatcount = getPostCount($ID);
     89        $subcatcount = sf_getPostCount($ID);
    9090
    9191        $category_link = esc_url( get_category_link( $category->term_id ) );
    92         $link_title = sprintf( __( "View all posts in %s (%s)" ), $category->name, $subcatcount );
     92        $link_title = sprintf( __( 'View all posts in %s (%s)', 'sf-category' ), $category->name, $subcatcount );
    9393        $catname = $category->name;
    9494       
     
    111111        $childcats = get_categories( $childargs );
    112112       
    113         doCategories( $childcats, $select_style, $ID );
     113        sf_doCategories( $childcats, $select_style, $ID );
    114114       
    115115        echo "
     
    152152        echo '<div class="dynamic_sidemenu">';
    153153       
    154         doCategories( $categories, $select_style );
     154        sf_doCategories( $categories, $select_style );
    155155       
    156156        echo '</div>';
     
    191191   
    192192        <p>
    193         <label for="<?php echo $this->get_field_id('select_style'); ?>"><?php _e('Style:', 'wp_widget_plugin'); ?></label>
     193        <label for="<?php echo $this->get_field_id('select_style'); ?>"><?php _e('Style:', 'sf-category'); ?></label>
    194194        <select name="<?php echo $this->get_field_name('select_style'); ?>" id="<?php echo $this->get_field_id('select_style'); ?>">
    195195        <?php
     
    203203       
    204204        <p>
    205         <label for="<?php echo $this->get_field_id('exclude_cat'); ?>"><?php _e('Exclude ID:', 'wp_widget_plugin'); ?></label>
     205        <label for="<?php echo $this->get_field_id('exclude_cat'); ?>"><?php _e('Exclude ID:', 'sf-category'); ?></label>
    206206        <input id="<?php echo $this->get_field_id('exclude_cat'); ?>" name="<?php echo $this->get_field_name('exclude_cat'); ?>" type="text" value="<?php echo $exclude_cat; ?>" />
    207207        </p>
     
    216216add_action( 'widgets_init', 'sf_category_menu_widget_register_widgets' );
    217217
    218 function load_jquery() {
     218function sf_category_load() {
    219219    wp_enqueue_script( 'jquery' );
    220220   
     
    224224}
    225225
    226 add_action( 'wp_enqueue_scripts', 'load_jquery' );
     226add_action( 'wp_enqueue_scripts', 'sf_category_load' );
     227
     228function sf_category_init() {
     229    load_textdomain( 'sf-category', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
     230}
     231add_action( 'plugins_loaded', 'sf_category_init' );
    227232
    228233
Note: See TracChangeset for help on using the changeset viewer.