Upload font files to media library

add_filter( ‘upload_mimes’, function( $mimes ) { $mimes[‘woff’] = ‘application/x-font-woff’; $mimes[‘woff2’] = ‘application/x-font-woff2’; $mimes[‘ttf’] = ‘application/x-font-ttf’; $mimes[‘svg’] = ‘image/svg+xml’; $mimes[‘eot’] = ‘application/vnd.ms-fontobject’; return $mimes; } );Continue reading

Show local fonts in block editor

add_filter( ‘block_editor_settings_all’, function( $editor_settings ) { $css = wp_get_custom_css_post()->post_content; $editor_settings[‘styles’][] = array( ‘css’ => $css ); return $editor_settings; } );Continue reading

Admin Bar – Updates

function add_updates_admin_bar_menu() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( ‘id’ => ‘updates’, ‘title’ => ‘Updates’, ‘href’ => admin_url( ‘update-core.php’ ), ‘parent’ => ‘top-secondary’, ) ); } add_action( ‘wp_before_admin_bar_render’, ‘add_updates_admin_bar_menu’ );Continue reading

Animacja Formularza

jQuery(“input , textarea”).focus(function(){ jQuery(this).parents(‘.elementor-field-group’).addClass(‘focused’); }); jQuery(“input , textarea”).blur(function(){ var inputValue = jQuery(this).val(); if ( inputValue == “” ) { jQuery(this).parents(‘.elementor-field-group’).removeClass(‘focused’); } });Continue reading

Custom Registration Fields

/** * Add fields to the registration form. * * @param array $fields * @return array */ add_filter( ‘charitable_user_registration_fields’, function( $fields ) { /* Add a text field. */ $fields[‘text_field’] = [ ‘type’ => ‘text’, ‘label’ => ‘My Text Field’,…Continue reading