| Server IP : 14.225.204.176 / Your IP : 216.73.216.6 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/ezine/wp-content/themes/ezine/ |
Upload File : |
<?php
define( 'EZINE_THEME_VERSION', '1.4.5' );
define( 'EZINE_THEME_NAME', esc_html_x( 'Ezine.', 'Theme Name', 'ezine' ) );
define( 'EZINE_THEME_PATH', trailingslashit( get_template_directory_uri() ) );
define( 'EZINE_SERVER_PATH', trailingslashit( get_template_directory() ) );
define( 'EZINE_DATE_FORMAT', get_option( 'date_format' ) );
/*
* Require core functionality
*/
$ezine_core = array( 'helpers', 'snippets', 'theme-support', 'ajax', 'template-tags', 'nav-menu', 'scripts', 'widgets', 'filters' );
foreach ( $ezine_core as $k ) {
locate_template( 'includes/core/'. sanitize_key( $k ) .'.php', true );
}
require_once trailingslashit( get_template_directory() ) . 'agg-theme-options/set.php';
/*
* Require TGM plugin activation
*/
locate_template( 'includes/admin/tgm.php', true );
/*
* Set content width
*/
if ( ! isset( $content_width ) ) {
$content_width = 750;
}
/*
* BuddyPress definitions
*/
if ( function_exists('buddypress') ) {
if ( ! defined( 'BP_AVATAR_FULL_WIDTH' ) ) {
define ( 'BP_AVATAR_FULL_WIDTH', 160 );
}
if ( ! defined( 'BP_AVATAR_FULL_HEIGHT' ) ) {
define ( 'BP_AVATAR_FULL_HEIGHT', 160 );
}
if ( ! defined( 'BP_AVATAR_THUMB_HEIGHT' ) ) {
define ( 'BP_AVATAR_THUMB_HEIGHT', 80 );
}
if ( ! defined( 'BP_AVATAR_THUMB_WIDTH' ) ) {
define ( 'BP_AVATAR_THUMB_WIDTH', 80 );
}
}
function slug_save_post_callback( $post_ID, $post, $update ) {
// allow 'publish', 'draft', 'future'
if ($post->post_type != 'post' || $post->post_status == 'auto-draft')
return;
if (strpos($post->post_name, $post->ID) === false)
return;
// use title, since $post->post_name might have unique numbers added
$new_slug = sanitize_title( $post->post_title, $post_ID );
$subtitle = current_time( 'timestamp', 1 );
$new_slug .= '-' . $subtitle;
if ($new_slug == $post->post_name)
return; // already set
// unhook this function to prevent infinite looping
remove_action( 'save_post', 'slug_save_post_callback', 10, 3 );
// update the post slug (WP handles unique post slug)
wp_update_post( array(
'ID' => $post_ID,
'post_name' => $new_slug
));
// re-hook this function
add_action( 'save_post', 'slug_save_post_callback', 10, 3 );
}
add_action( 'save_post', 'slug_save_post_callback', 10, 3 );