__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace EssentialBlocks\Core;
use EssentialBlocks\Traits\HasSingletone;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class ModifyWPCore {
use HasSingletone;
public function __construct() {
$post_types = get_post_types(
array(
'public' => true,
)
);
if ( is_array( $post_types ) && count( $post_types ) > 0 ) {
foreach ( $post_types as $post ) {
add_filter( 'rest_' . $post . '_collection_params', array( $this, 'filterPostQueryArgs' ), 2, 10 );
}
}
}
public static function filterPostQueryArgs( $query_params, $post_type ) {
$query_params['orderby']['enum'] = array_merge( $query_params['orderby']['enum'], array( 'rand', 'menu_order', 'comment_count' ) );
return $query_params;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Block.php | File | 5.61 KB | 0640 |
|
| Blocks.php | File | 4.69 KB | 0640 |
|
| BlocksPatterns.php | File | 6.88 KB | 0640 |
|
| FaqSchema.php | File | 6.88 KB | 0640 |
|
| FontLoader.php | File | 4.79 KB | 0640 |
|
| Maintenance.php | File | 5.06 KB | 0640 |
|
| ModifyWPCore.php | File | 761 B | 0640 |
|
| PageTemplates.php | File | 4.87 KB | 0640 |
|
| PostMeta.php | File | 637 B | 0640 |
|
| Scripts.php | File | 30.98 KB | 0640 |
|