'share-slugs', 'title' => __( 'Share slugs', 'polylang' ), 'description' => __( 'Allows to share the same url slug accross languages for posts and terms.', 'polylang' ), ) ); if ( class_exists( 'PLL_Share_Post_Slug', true ) && get_option( 'permalink_structure' ) ) { add_action( 'admin_print_footer_scripts', array( $this, 'print_js' ) ); } } /** * tells if the module is active * * @since 1.9 * * @return bool */ public function is_active() { return class_exists( 'PLL_Share_Post_Slug', true ) && $this->options['force_lang'] && get_option( 'permalink_structure' ); } /** * displays upgrade message * * @since 1.9 * * @return string */ public function get_upgrade_message() { return class_exists( 'PLL_Share_Post_Slug', true ) ? '' : $this->default_upgrade_message(); } /** * displays the javascript to handle dynamically the change in url modifications * as sharing slugs is not possible when the language is set from the content * * @since 1.9 */ public function print_js() { wp_enqueue_script( 'jquery' ); $activated = sprintf( '%s', $this->action_links['activated'] ); $deactivated = sprintf( '%s', $this->action_links['deactivated'] ); ?>