Commit inicial powerservice
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function alcastromol_setup_comment_settings() {
|
||||
|
||||
if (get_option('alcastromol_comments_done')) {
|
||||
return;
|
||||
}
|
||||
|
||||
update_option('default_pingback_flag', 1);
|
||||
update_option('default_ping_status', 'closed');
|
||||
update_option('default_comment_status', 'closed');
|
||||
|
||||
update_option('require_name_email', 1);
|
||||
update_option('comment_registration', 1);
|
||||
update_option('close_comments_for_old_posts', 1);
|
||||
update_option('close_comments_days_old', 14);
|
||||
update_option('show_comments_cookies_opt_in', 1);
|
||||
update_option('thread_comments', 1);
|
||||
update_option('thread_comments_depth', 5);
|
||||
|
||||
update_option('page_comments', 0);
|
||||
update_option('comments_per_page', 50);
|
||||
update_option('default_comments_page', 'last');
|
||||
update_option('comment_order', 'asc');
|
||||
|
||||
update_option('comments_notify', 1);
|
||||
update_option('moderation_notify', 1);
|
||||
|
||||
update_option('comment_moderation', 1);
|
||||
update_option('comment_previously_approved', 1);
|
||||
|
||||
update_option('alcastromol_comments_done', 1);
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function alcastromol_setup_general_settings() {
|
||||
|
||||
if (get_option('alcastromol_general_done')) {
|
||||
return;
|
||||
}
|
||||
|
||||
update_option('WPLANG', 'es_MX');
|
||||
|
||||
update_option('timezone_string', 'America/Mexico_City');
|
||||
|
||||
update_option('date_format', 'd/m/Y');
|
||||
|
||||
update_option('time_format', 'g:i a');
|
||||
|
||||
update_option('alcastromol_general_done', 1);
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function alcastromol_setup_permalinks() {
|
||||
|
||||
global $wp_rewrite;
|
||||
|
||||
$structure = '/%postname%';
|
||||
|
||||
update_option('permalink_structure', $structure);
|
||||
|
||||
$wp_rewrite->set_permalink_structure($structure);
|
||||
|
||||
$wp_rewrite->use_trailing_slashes = false;
|
||||
|
||||
flush_rewrite_rules();
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Desactivar actualizaciones automáticas
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if (!defined('AUTOMATIC_UPDATER_DISABLED')) {
|
||||
define('AUTOMATIC_UPDATER_DISABLED', true);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Optimización de recursos (Heartbeat + Cron)
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
add_action('init', 'alcastromol_admin_optimizations');
|
||||
|
||||
function alcastromol_admin_optimizations() {
|
||||
|
||||
// Desactivar Heartbeat en frontend
|
||||
if (!is_admin()) {
|
||||
wp_deregister_script('heartbeat');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Desactivar pantalla completa en editor de bloques
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
add_action('enqueue_block_editor_assets', 'alcastromol_disable_fullscreen_editor');
|
||||
|
||||
function alcastromol_disable_fullscreen_editor() {
|
||||
|
||||
$script = "
|
||||
window.onload = function() {
|
||||
const isFullscreenMode = wp.data.select('core/edit-post').isFeatureActive('fullscreenMode');
|
||||
if (isFullscreenMode) {
|
||||
wp.data.dispatch('core/edit-post').toggleFeature('fullscreenMode');
|
||||
}
|
||||
}";
|
||||
|
||||
wp_add_inline_script('wp-blocks', $script);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Categorías y Tags para Media
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
add_action('init', 'alcastromol_media_taxonomies');
|
||||
|
||||
function alcastromol_media_taxonomies() {
|
||||
|
||||
register_taxonomy_for_object_type('category', 'attachment');
|
||||
register_taxonomy_for_object_type('post_tag', 'attachment');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Configuración inicial de comentarios
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
function alcastromol_comment_settings() {
|
||||
|
||||
update_option('comment_moderation', 1);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user