| Server IP : 77.50.203.18 / Your IP : 192.168.0.10 Web Server : Apache/2.4.62 (CentOS Stream) OpenSSL/3.5.7 mpm-itk/2.4.7-04 PHP/8.4.23 System : Linux web2 5.14.0-722.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 6 09:07:51 UTC 2026 x86_64 User : warsnews.ru ( 1001) PHP Version : 8.4.23 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/ifwar.ru/www/wp-content/plugins/clever-fox/inc/aravalli/default-pages/ |
Upload File : |
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
//post status and options
$post = array(
'comment_status' => 'closed',
'ping_status' => 'closed' ,
'post_author' => 1,
'post_date' => gmdate('Y-m-d H:i:s'),
'post_name' => 'Home',
'post_status' => 'publish' ,
'post_title' => 'Home',
'post_type' => 'page',
);
//insert page and save the id
$cleverfox_newvalue = wp_insert_post( $post, false );
if ( $cleverfox_newvalue && ! is_wp_error( $cleverfox_newvalue ) ){
update_post_meta( $cleverfox_newvalue, '_wp_page_template', 'templates/template-homepage.php' );
// Use a static front page
$cleverfox_array_of_objects = get_posts([
'title' => 'Home',
'post_type' => 'any',
]);
$page = $cleverfox_array_of_objects[0];//Be sure you have an array with single post or page
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $page->ID );
}
?>