add_strings example

/** * Plugin info. * * The Plugin_Upgrader::bulk_upgrade() method will fill this in * with info retrieved from the get_plugin_data() function. * * @var array Plugin data. Values will be empty if not supplied by the plugin. */
    public $plugin_info = array();

    public function add_strings() {
        parent::add_strings();
        /* translators: 1: Plugin name, 2: Number of the plugin, 3: Total number of plugins being updated. */
        $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)' );
    }

    /** * @param string $title */
    public function before( $title = '' ) {
        parent::before( $this->plugin_info['Title'] );
    }

    

    public $theme_info = false;

    public function add_strings() {
        parent::add_strings();
        /* translators: 1: Theme name, 2: Number of the theme, 3: Total number of themes being updated. */
        $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Theme %1$s (%2$d/%3$d)' );
    }

    /** * @param string $title */
    public function before( $title = '' ) {
        parent::before( $this->theme_info->display( 'Name' ) );
    }

    


    /** * @since 2.8.0 * * @param WP_Upgrader $upgrader */
    public function set_upgrader( &$upgrader ) {
        if ( is_object( $upgrader ) ) {
            $this->upgrader =& $upgrader;
        }
        $this->add_strings();
    }

    /** * @since 3.0.0 */
    public function add_strings() {
    }

    /** * Sets the result of an upgrade. * * @since 2.8.0 * * @param string|bool|WP_Error $result The result of an upgrade. */
Home | Imprint | This part of the site doesn't use cookies.