Viewing 1 replies (of 1 total)
  • Thread Starter Daisuke Takahashi

    (@extendwings)

    Here is my fixed code(send-to-kindle.php):

    private function __construct() {
    		load_plugin_textdomain( "kindle", false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
    		// Set up sensible defaults.
    		add_option( 'stk_button_look', array(
    			// placement
    			'home' => true,
    			'archive' => true,
    			'post' => true,
    			'page' => false,
    			'before' => false,
    			'after' => false,
    			// button style
    			'color' => 'white',
    			'size' => 'small',
    			'border' => true,
    			'theme' => 'light',
    			// button text
    			'text' => 'send-to-kindle',
    			'font' => 'sans-serif',
    		) );
    		add_option( 'stk_button_advanced', array(
    			'selectors' => array(
    				'title' => '.entry-title',
    				'published' => '.entry-date',
    				'content' => '.post',
    				'exclude' => '.sharedaddy',
    			),
    			'enabled' => false,
    			'markup' => '<div class="kindleWidget">Kindle</div>',
    		) );
    
    		// Register actions and filters.
    		add_shortcode( 'sendtokindle', array( $this, 'get_button_html' ) );
    		add_filter( 'the_content', array( $this, 'attach_to_content' ) );
    		add_filter( 'get_the_excerpt', array( $this, 'clean_the_excerpt' ) );
    		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_script' ) );
    		if ( is_admin() ) {
    			// Only load settings screens for admins.
    			add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ),
    					array( $this, 'settings_link' ) );
    			if ( ! class_exists( 'STK_Settings' ) ) {
    				include_once( dirname( __FILE__ ) . '/admin/settings.php' );
    			}
    			if ( ! class_exists( 'STK_Settings_Advanced' ) ) {
    				include_once( dirname( __FILE__ ) . '/admin/settings-advanced.php' );
    			}
    			$settings = STK_Settings::get_instance();
    			$advanced_settings = STK_Settings_Advanced::get_instance();
    		}
    	}

    I hope you will find it helpful.

Viewing 1 replies (of 1 total)
  • The topic ‘Japanese language files’ is closed to new replies.