post_type || false !== strpos( (string) $screen->id, Wp360_Shortlink_Service_Admin_Page::SLUG ); } public static function add_meta_boxes() { add_meta_box( 'wp360-sl-target', __( 'Shortlink', '360-orbit-shortlink-service' ), array( __CLASS__, 'render_target_box' ), Wp360_Shortlink_Service_Post_Type::POST_TYPE, 'normal', 'high' ); } /** * @param string $title Vorgabetext des Titelfelds. * @param WP_Post $post Aktueller Beitrag. * @return string */ public static function title_placeholder( $title, $post ) { if ( $post && Wp360_Shortlink_Service_Post_Type::POST_TYPE === $post->post_type ) { return __( 'Name of the link (for your own overview)', '360-orbit-shortlink-service' ); } return $title; } /** * Quick-Edit liesse den Slug und den Titel an der Maske vorbei aendern. * * @param bool $enabled Ob Quick-Edit angeboten wird. * @param string $post_type Beitragstyp. * @return bool */ public static function disable_quick_edit( $enabled, $post_type ) { return Wp360_Shortlink_Service_Post_Type::POST_TYPE === $post_type ? false : $enabled; } /** * @param WP_Post $post Aktueller Shortlink. */ public static function render_target_box( $post ) { $slug = Wp360_Shortlink_Service_Post_Type::get_slug( $post->ID ); $url = Wp360_Shortlink_Service_Post_Type::get_target_url( $post->ID ); wp_nonce_field( Wp360_Shortlink_Service_Post_Type::URL_NONCE_ACTION, Wp360_Shortlink_Service_Post_Type::URL_NONCE_FIELD ); ?>
%2$s
', esc_attr( $type ), esc_html( $notice['message'] ) ); } if ( '' === (string) get_option( 'permalink_structure' ) ) { printf( '%1$s %3$s