load_plugin_textdomain example


        }
    }

    // this fires on wp_insert_comment. we can't update comment_meta when auto_check_comment() runs     // because we don't know the comment ID at that point.     public static function auto_check_update_meta( $id$comment ) {
        // wp_insert_comment() might be called in other contexts, so make sure this is the same comment         // as was checked by auto_check_comment         if ( is_object( $comment ) && !empty( self::$last_comment ) && is_array( self::$last_comment ) ) {
            if ( self::matches_last_comment( $comment ) ) {
                load_plugin_textdomain( 'akismet' );

                // normal result: true or false                 if ( self::$last_comment['akismet_result'] == 'true' ) {
                    update_comment_meta( $comment->comment_ID, 'akismet_result', 'true' );
                    self::update_comment_history( $comment->comment_ID, '', 'check-spam' );
                    if ( $comment->comment_approved != 'spam' ) {
                        self::update_comment_history(
                            $comment->comment_ID,
                            '',
                            'status-changed-' . $comment->comment_approved
                        );
                    }


    public static function admin_init() {
        if ( get_option( 'Activated_Akismet' ) ) {
            delete_option( 'Activated_Akismet' );
            if ( ! headers_sent() ) {
                $admin_url = self::get_page_url( 'init' );
                wp_redirect( $admin_url );
            }
        }

        load_plugin_textdomain( 'akismet' );
        add_meta_box( 'akismet-status', __('Comment History', 'akismet'), array( 'Akismet_Admin', 'comment_status_meta_box' ), 'comment', 'normal' );

        if ( function_exists( 'wp_add_privacy_policy_content' ) ) {
            wp_add_privacy_policy_content(
                __( 'Akismet', 'akismet' ),
                __( 'We collect information about visitors who comment on Sites that use our Akismet anti-spam service. The information we collect depends on how the User sets up Akismet for the Site, but typically includes the commenter\'s IP address, user agent, referrer, and Site URL (along with other information directly provided by the commenter such as their name, username, email address, and the comment itself).', 'akismet' )
            );
        }
    }

    public static function admin_menu() {
        
<?php /** * @package Akismet */
class Akismet_Widget extends WP_Widget {

    function __construct() {
        load_plugin_textdomain( 'akismet' );
        
        parent::__construct(
            'akismet_widget',
            __( 'Akismet Widget' , 'akismet'),
            array( 'description' => __( 'Display the number of spam comments Akismet has caught' , 'akismet') )
        );

        if ( is_active_widget( false, false, $this->id_base ) ) {
            add_action( 'wp_head', array( $this, 'css' ) );
        }
    }

    
function _get_plugin_data_markup_translate( $plugin_file$plugin_data$markup = true, $translate = true ) {

    // Sanitize the plugin filename to a WP_PLUGIN_DIR relative path.     $plugin_file = plugin_basename( $plugin_file );

    // Translate fields.     if ( $translate ) {
        $textdomain = $plugin_data['TextDomain'];
        if ( $textdomain ) {
            if ( ! is_textdomain_loaded( $textdomain ) ) {
                if ( $plugin_data['DomainPath'] ) {
                    load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] );
                } else {
                    load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) );
                }
            }
        } elseif ( 'hello.php' === basename( $plugin_file ) ) {
            $textdomain = 'default';
        }
        if ( $textdomain ) {
            foreach ( array( 'Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version' ) as $field ) {
                if ( ! empty( $plugin_data[ $field ] ) ) {
                    // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain
Home | Imprint | This part of the site doesn't use cookies.