• On posts-to-posts.php,

    load_plugin_textdomain( P2P_TEXTDOMAIN, '', basename( dirname( __FILE__ ) ) . '/lang' );

    is being called on _p2p_load() function.

    I think it should be called on _p2p_init() function, right before the do_action(‘p2p_init’)

    The only reason is this way i can overwrite any translations using a mo file outside the plugin folder.

    https://ww.wp.xz.cn/plugins/posts-to-posts/

The topic ‘Suggestion for better translation php code’ is closed to new replies.