Powered By Blogger
Showing posts with label wp-admin. Show all posts
Showing posts with label wp-admin. Show all posts

Thursday, July 13, 2017

remove quick edit and inline row below post list in wp-admin

function.php

function remove_quick_edit( $actions, $post) {
  if ($post->post_type =="tribe_events"){
    unset($actions['inline hide-if-no-js']);
    unset($actions['edit']);
    unset($actions['trash']);
    unset($actions['view']);
    }
  return $actions;
}
add_filter('post_row_actions','remove_quick_edit',10,2);

Friday, December 30, 2016

add input field in wp admin and Global Options Page and custom form in wp admin

http://stackoverflow.com/questions/11715465/how-do-i-create-a-universal-custom-field-in-wordpress

/** EGR Magnificent config in wp-admin */
add_action( 'admin_menu', 'my_plugin_menu' );

function my_plugin_menu() {
add_options_page( 'Magnificent', 'Magnificent API', 'manage_options', 'magnificent-config', 'EGR_magnificent_options' );
}

function EGR_magnificent_options() {
if ( !current_user_can( 'manage_options' ) )  {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
echo '<div class="wrap">';
echo '<p>EGR Magnificent API configuration.</p><form method="post" action="options.php">';
             wp_nonce_field('update-options');
    echo '   <p><strong>JWT token secret key:</strong><br />
                <input type="text" name="jwtsecret" size="45" value="'; echo get_option('jwtsecret');
                echo '" />
                <br /><strong>JWT token expiry time (in minutes):</strong><br />
                <input type="number" name="jwtexpire" size="45" value="'; echo get_option('jwtexpire');
                echo '" />
            </p>
            <p><input type="submit" name="Submit" value="Store Options" /></p>
            <input type="hidden" name="action" value="update" />
            <input type="hidden" name="page_options" value="jwtsecret, jwtexpire" />
        </form>';
echo '</div>';
}