for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the WPFoundation library.
*
* Copyright (c) 2015 LIN3S <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace LIN3S\WPFoundation\PostTypes\Fields\Templates;
use LIN3S\WPFoundation\PostTypes\Fields\Fields;
/**
* Abstract page fields class that extends the fields basic
* behaviour, implementing the "connector" and "removeScreenAttributes"
* methods with the common use case.
* @author Beñat Espiña <[email protected]>
abstract class PageFields extends Fields
{
* {@inheritdoc}
public function connector()
return [
[
'param' => 'post_type',
'operator' => '==',
'value' => 'page',
],
'param' => 'page_template',
'value' => $this->name,
];
}
public function removeScreenAttributes()
remove_post_type_support('page', 'comments');
remove_post_type_support('page', 'custom-fields');
remove_post_type_support('page', 'editor');