post_type ) && ( $post->post_type === 'wplng_translation' || $post->post_type === 'wplng_slug' ) ) { return true; } return false; } /** * Customize the admin footer text displayed on wpLingua option pages. * * @param string $text The default footer text. * @return string The customized footer text for wpLingua pages. */ function wplng_admin_footer_text( $text ) { if ( wplng_is_wplingua_admin_page() ) { $text = ' '; if ( empty( wplng_get_api_data() ) ) { $text .= esc_html__( 'Thank you for choosing wpLingua!', 'wplingua' ); } else { $text .= sprintf( esc_html__( 'If you like wpLingua please leave us a %1$s rating. A huge thanks!', 'wplingua' ), '★★★★★' ); } } return $text; } /** * Set custom update_footer text on wpLingua options pages * * @param string $text The default footer text to be modified. * @return string The customized footer text for wpLingua pages. */ function wplng_update_footer( $text ) { if ( wplng_is_wplingua_admin_page() ) { $text = ''; $text .= 'wplingua.com'; $text .= ' | '; $text .= ''; $text .= 'GitHub'; $text .= ' | '; $text .= esc_html__( 'Version', 'wplingua' ); $text .= ' ' . esc_html( WPLNG_PLUGIN_VERSION ); } return $text; } /** * Add 'Settings' link on wpLingua in the plugin list * * @param array $settings * @return array */ function wplng_settings_link( $settings ) { $url = add_query_arg( 'page', 'wplingua-settings', get_admin_url() . 'admin.php' ); $link = ''; $link .= esc_html__( 'Settings', 'wplingua' ); $link .= ''; $settings[] = $link; return $settings; } /** * Redirect to the wpLingua settings page upon plugin activation. * * @param string $plugin The plugin file path that was activated. * @return void */ function wplng_plugin_activation_redirect( $plugin ) { if ( ! wp_doing_ajax() && WPLNG_PLUGIN_FILE === $plugin ) { wp_safe_redirect( admin_url( 'admin.php?page=wplingua-settings' ) ); exit(); } } /** * Display a notice if the plugin is activate but not configured * * @return void */ function wplng_admin_notice_no_key_set() { $url = add_query_arg( 'page', 'wplingua-settings', get_admin_url() . 'admin.php' ); $html = '
'; $html .= ' '; $html .= esc_html__( 'wpLingua - Translation solution for multilingual website', 'wplingua' ); $html .= '
'; $html .= '';
$html .= esc_html__( 'wpLingua is installed, but not yet configured. You are just a few clicks away from making your website multilingual!', 'wplingua' );
$html .= '
';
$html .= '';
$html .= esc_html__( 'Go to the configuration page', 'wplingua' );
$html .= '';
$html .= '