Function Reference: geodir_check_quick_edit

Summary

Set hooks to disable quick edit links for GD post types.

Global Values

$pagenow
(string) (required) The current screen.

Default: None
$current_screen
(object) (required) The current screen object.

Default: None
$gd_cpt_screen
(bool) (required) True if current scrrrn has GD post type.

Default: None

Package

GeoDirectory

Change Log

Since: 1.6.22

Source File

geodir_check_quick_edit() is located in geodirectory-admin/admin_hooks_actions.php [Line: 2578]

Source Code

function geodir_check_quick_edit() {
    global $pagenow, $current_screen, $gd_cpt_screen;

    if ( ( $pagenow == 'edit.php' || $pagenow == 'edit-tags.php' ) && !empty( $current_screen->post_type ) ) {
        if ( empty( $gd_cpt_screen ) ) {
            if ( in_array( $current_screen->post_type, geodir_get_posttypes() ) ) {
                $gd_cpt_screen = 'y';
            } else {
                $gd_cpt_screen = 'n';
            }
        }

        if ( $gd_cpt_screen == 'y' ) {
            if ( $pagenow == 'edit.php' ) {
                add_filter( 'post_row_actions', 'geodir_disable_quick_edit', 10, 2 );
                add_filter( 'page_row_actions', 'geodir_disable_quick_edit', 10, 2 );
            } elseif ( $pagenow == 'edit-tags.php' && !empty( $current_screen->taxonomy ) ) {
                add_filter( $current_screen->taxonomy . '_row_actions', 'geodir_disable_quick_edit', 10, 2 );
            }
        }
    }
}