Removes the post type "post/page" from admin
@return NULL
184611
public function removePostPostType()
    {
        global $wp_post_types;

        if (isset($wp_post_types['post'])) {
            if (function_exists('get_field') && get_field('disable_default_blog_post_type', 'option')) {
                add_action('admin_menu', function () {
                    remove_menu_page('edit.php');
                });

                add_action('wp_before_admin_bar_render', function () {
                    global $wp_admin_bar;
                    $wp_admin_bar->remove_menu('new-post');
                });
            }
        }

        if (isset($wp_post_types['page'])) {
            if (function_exists('get_field') && get_field('disable_default_page_post_type', 'option')) {
                add_action('admin_menu', function () {
                    remove_menu_page('edit.php?post_type=page');
                });

                add_action('wp_before_admin_bar_render', function () {
                    global $wp_admin_bar;
                    $wp_admin_bar->remove_menu('new-page');
                });
            }
        }

        return null;
    }
478522
protected function RemovalObject()
    {
        $id = Request::PostData('delete');
        return $id ? Article::Schema()->ByID($id) : null;
    }
548524
public function admin_head() {

		if ( self::get_current_post_type() !== $this->cpt->post_type ) {
			return;
		}

		?>
		<?php if ( isset( $this->args['admin_filters']['m'] ) && ! $this->args['admin_filters']['m'] ) { ?>
			<style type="text/css">
				#posts-filter select[name="m"] {
					display: none;
				}
			</style>
		<?php } ?>
		<?php

	}
843379
public function actionRemove()
    {
        $routes = Yii::$app->getRequest()->post('routes', []);
        $model = new AdminRoute();
        $model->remove($routes);
        Yii::$app->getResponse()->format = Response::FORMAT_JSON;
        return $model->getRoutes();
    }
968020
public function postAdmin(Request $request, Page $page)
    {
        $this->authorize('editAdmin', $page);

        $page
            ->setInternalName($request->input('internal_name'))
            ->setAddPageBehaviour($request->input('add_behaviour'))
            ->setChildAddPageBehaviour($request->input('child_add_behaviour'))
            ->setDisableDelete($request->has('disable_delete'));

        PageFacade::save($page);
    }
3662
function clear( $network_level_or_blog_id = null, $flush = false ) {
            if ( ! $this->_is_multisite ||
                 false === $network_level_or_blog_id ||
                 is_null( $network_level_or_blog_id ) ||
                 is_numeric( $network_level_or_blog_id )
            ) {
                $site_options = $this->get_site_options( $network_level_or_blog_id );
                $site_options->clear( $flush );
            }

            if ( $this->_is_multisite &&
                 ( true === $network_level_or_blog_id || is_null( $network_level_or_blog_id ) )
            ) {
                $this->_network_options->clear( $flush );
            }
        }
915762
public function delete(Page $page)
    {
        $endpoint = '/admin/pages/'.$page->id.'.json';
        $response = $this->request($endpoint, 'DELETE');
        return;
    }
1256200
public function getRequestedPostTypeArchivePermalink()
    {
        $requested_post_type = $this->getRequestedPostType();

        if (!is_null($requested_post_type)) {
            $this->data['post_type_permalink']  = get_post_type_archive_link($requested_post_type);
        } else {
            $this->data['post_type_permalink'] = false;
        }

        return;
    }
678781
public function delete()
	{
		if ( ! $this->is_loaded() ) return false;

		$error = wp_delete_post( $this->attributes['ID'], $this->forceDelete );

		return $error !== false;
	}
237053
private function softDelete(Page $page)
    {
        if ($page->isRoot()) {
            throw new BadRequestHttpException('Cannot remove root page of a site.');
        }

        $this->granted('DELETE', $page);
        $this->granted('EDIT', $page->getParent()); // user must have edit permission on parent

        if ($page->isOnline(true)) {
            $this->granted('PUBLISH', $page); // user must have publish permission on the page
        }

        $this->getPageRepository()->toTrash($page);
    }
1245721
protected function getAdminPageHook() {
		global $pagenow, $typenow, $plugin_page;

		$page_hook = '';
		if ( isset( $plugin_page ) ) {
			if ( ! empty( $typenow ) ) {
				$the_parent = $pagenow . '?post_type=' . $typenow;
			} else {
				$the_parent = $pagenow;
			}

			$page_hook = get_plugin_page_hook( $plugin_page, $the_parent );
		}

		return $page_hook;
	}
976725
def destroy
      Post.disable_post(params[:id])
      respond_to do |format|
        format.html { redirect_to admin_pages_path, notice: I18n.t("controllers.admin.pages.destroy.flash.success") }
      end
    end
549704
public function getRequestedPostType()
    {
        if (!is_a($this->query, 'WP_Query')) {
            return null;
        }

        if (isset($this->query->query) && isset($this->query->query['post_type'])) {
            return $this->data['post_type'] = $this->query->query['post_type'];
        } else {
            return $this->data['post_type'] = null;
        }
    }
701892
public function cleanParams()
    {
        $_GET    = array();
        $_POST   = array();
        $_FILES  = array();
        $_COOKIE = array();

        foreach ($this->getRequestHeader() as $key) {
            if (array_key_exists($key, $_SERVER)) {
                unset($_SERVER[$key]);
            }
        }
    }
777171
public function getPostTypeConfig()
    {
        if (in_array($this->getPostType(), array('post', 'page'))) {
            return null;
        }
        
        return array(
            'labels' => array(
                'name'              => _x($this->getPlural(), 'post type general name'),
                'singular_name'     => _x($this->getSingular(), 'post type singular name'),
                'add_new'           => _x('Add New', $this->getSingular()),
                'add_new_item'      => __(sprintf('Add New %s', $this->getSingular())),
                'edit_item'         => __(sprintf('Edit %s', $this->getSingular())),
                'new_item'          => __(sprintf('New %s', $this->getPlural())),
                'view_item'         => __(sprintf('View %s', $this->getSingular())),
                'search_items'      => __(sprintf('Search %s', $this->getPlural())),
                'not_found'         => __(sprintf('No %s found', $this->getPlural())),
                'not_found_in_trash'=> __(sprintf('No %s found in Trash', $this->getPlural())),
                'parent_item_colon' => ''
            ),
            'hierarchical'        => $this->getHierarchical(),
            'public'              => $this->getPublic(),
            'supports'            => $this->getSupports(),
            'show_in_menu'        => $this->getShowInMenu(),
            'show_in_admin_bar'   => $this->getShowInAdminBar(),
            'menu_icon'           => $this->getMenuIcon(),
            'menu_position'       => $this->getMenuPosition(),
            'exclude_from_search' => $this->getExcludeFromSearch(),
            'has_archive'         => $this->getHasArchive(),
            'rewrite'             => $this->getRewrite(),
            'publicly_queryable'  => $this->getPubliclyQueryable(),
        );
    }
57023
private function register_post_type() {
		$post_type            = $this->get_post_type();
		$this->_post_type_obj = register_post_type( $post_type, $this->get_post_type_args() );
		if ( is_wp_error( $this->_post_type_obj ) ) {
			$this->app->log( $this->_post_type_obj );

			return;
		}
		add_filter( "views_edit-{$post_type}", function ( $views ) {
			unset( $views['mine'] );
			unset( $views['publish'] );

			return $views;
		} );
		add_filter( "bulk_actions-edit-{$post_type}", function ( $actions ) {
			unset( $actions['edit'] );

			return $actions;
		} );
		add_filter( "manage_edit-{$post_type}_sortable_columns", function ( $sortable_columns ) {
			return $this->manage_posts_columns( $sortable_columns, true );
		} );
	}
627600
public function delete()
    {
        if (!userHasPermission('admin:blog:post:' . $this->blog->id . ':delete')) {

            unauthorised();
        }

        // --------------------------------------------------------------------------

        //  Fetch and check post
        $iPostId = (int) $this->uri->segment(6);
        $oPost   = $this->blog_post_model->getById($iPostId);

        if (!$oPost || $oPost->blog->id != $this->blog->id) {

            $this->session->set_flashdata('error', 'I could\'t find a post by that ID.');
            redirect('admin/blog/post/index/' . $this->blog->id);
        }

        // --------------------------------------------------------------------------

        if ($this->blog_post_model->delete($iPostId)) {

            $sStatus  = 'success';
            $sMessage = ucfirst($this->data['postName']) . ' was deleted successfully. ';
            if (userHasPermission('admin:blog:post:' . $this->blog->id . ':restore')) {
                $sMessage .= anchor('admin/blog/post/restore/' . $this->blog->id . '/' . $iPostId, 'Undo?');
            }

            //  Update admin changelog
            $this->oChangeLogModel->add('deleted', 'a', 'blog post', $iPostId, $oPost->title);

        } else {

            $sStatus  = 'error';
            $sMessage = 'I failed to delete that post. ' . $this->blog_post_model->lastError();
        }

        $this->session->set_flashdata($sStatus, $sMessage);

        redirect('admin/blog/post/index/' . $this->blog->id);
    }