AnsPress_Admin::page_select_field_opt( object $field )

Description #

Add link to view, edit and create right next to page select field.

Parameters #

  • $field
    object (Required) Field object.

Source #

File: admin/anspress-admin.php

	public static function page_select_field_opt( $field ) {
		$page_slugs = array_keys( ap_main_pages() );

		// Return if not the field we are looking for.
		if ( ! in_array( $field->original_name, $page_slugs, true ) ) {
			return;
		}

		$field->add_html( '&nbsp;&nbsp;&nbsp;<a href="' . esc_url( get_permalink( $field->value() ) ) . '">' . __( 'View page', 'anspress-question-answer' ) . '</a>&nbsp;&nbsp;&nbsp;' );
		$field->add_html( '<a href="' . esc_url( get_edit_post_link( $field->value() ) ) . '">' . __( 'Edit page', 'anspress-question-answer' ) . '</a>' );
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment