Skip to content

Instantly share code, notes, and snippets.

# nastaveni ftp serveru
variables:
# devel server
FTP_DEV_URL: "***"
FTP_DEV_USERNAME: "***"
FTP_DEV_PASSWORD: "***"
# produkce
FTP_PROD_URL: "***"
FTP_PROD_USERNAME: "***"
FTP_PROD_PASSWORD: "***"
# nastaveni ftp serveru
variables:
FTP_URL: "***"
FTP_USERNAME: "***"
FTP_PASSWORD: "***"
deploy:
# nazev akce
stage: deploy
# natazeni docker image s git-ftp
wp_dequeue_style( 'wp-block-library' );
// přesunutí Yoast SEO dolů
function yoast_bottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoast_bottom');
// povolení vybraných bloků v editoru
function editor_allow_types( $allowed_blocks ) {
return array(
'core/image',
'core/paragraph',
'core/heading',
'core/list',
'core/table'
);
// aktivní položky v menu pro custom post type detaily
function custom_active_item_classes( $classes = array(), $menu_item = false ) {
global $post;
$classes[] = ( $menu_item->url == get_post_type_archive_link($post->post_type) ) ? 'current-menu-item' : '';
return $classes;
}
add_filter( 'nav_menu_css_class', 'custom_active_item_classes', 10, 2 );
<IfModule mod_headers.c>
# X-XSS-Protection
Header set X-XSS-Protection "1; mode=block"
# X-Content-Type-Options
Header set X-Content-Type-Options nosniff
# X-Download-Options
Header set X-Download-Options: noopen
# X-Frame-Options settings
Header set X-Frame-Options DENY
# Referrer-Policy settings
RewriteEngine On
# redirection all http -> https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# redirection -> www.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
add_action( 'wp_enqueue_scripts', function () {
wp_dequeue_script( 'jquery' );
wp_deregister_script( 'jquery' );
wp_register_script(
'jquery',
false,
array( 'jquery-core', 'jquery-migrate' ),
true
);
});
// odstranění jquery migrate
function isa_remove_jquery_migrate( &$scripts) {
if(!is_admin()) {
$scripts->remove( 'jquery');
$scripts->add( 'jquery', false, array( 'jquery-core' ), '1.12.4' );
}
}
add_filter( 'wp_default_scripts', 'isa_remove_jquery_migrate' );