Skip to content

Instantly share code, notes, and snippets.

View pavelrich's full-sized avatar
🌍
Working

Pavel Richter pavelrich

🌍
Working
View GitHub Profile
@pavelrich
pavelrich / functions.php
Last active October 22, 2021 00:12
Muse WordPress Theme — [muse-section section="SECTION"] Shortcode to Display the Section
<?php
if ( ! function_exists( 'muse_shortcode_section' ) ) {
/**
* [muse-section section="SECTION"] Shortcode to Display the Section
*
* @param $attrs
*
* @return false|string
@pavelrich
pavelrich / functions.php
Created March 14, 2021 21:41
WordPress — Disable Automatic Trim of the Content to the Excerpt
<?php
// Disable Automatic Trim of the Content to the Excerpt
remove_filter( 'get_the_excerpt', 'wp_trim_excerpt' );
@pavelrich
pavelrich / functions.php
Last active October 21, 2021 23:51
FORQY — Custom Settings of the jQuery UI Datepicker — Disable selection of today
<?php
if ( ! function_exists( 'prefix_scripts_datepicker' ) ) {
/**
* Custom Settings of the jQuery UI Datepicker
*/
function prefix_scripts_datepicker() {
$datepicker = '
@pavelrich
pavelrich / functions.php
Last active October 21, 2021 23:55
FORQY — Menu — Custom Scripts for the 'menu' Post Type — Singular
<?php
if ( ! function_exists( 'prefix_scripts' ) ) {
/**
* Custom Scripts for the 'menu' Post Type
*/
function prefix_scripts() {
if ( is_singular( 'menu' ) ) {
@pavelrich
pavelrich / functions.php
Last active March 23, 2023 03:39
WordPress — Remove 'type' Attribute of Scripts and Styles
<?php
if ( ! function_exists( 'prefix_remove_type_attr' ) ) {
/**
* Remove 'type' Attribute of Scripts and Styles
*/
function prefix_remove_type_attr( $tag ) {
return preg_replace( "/type=['\"]text\/(javascript|css)['\"]/", '', $tag );
}
@pavelrich
pavelrich / functions.php
Created November 20, 2019 11:22
WordPress — Unregister "reservation" Post Type
<?php
// Unregister "reservation" post type
if ( ! function_exists( 'forqy_unregister_post_type_reservation' ) ) {
function forqy_unregister_post_type_reservation() {
unregister_post_type( 'reservation' );
}
@pavelrich
pavelrich / functions.php
Last active October 21, 2021 23:57
FORQY Socials — Add/change Social Icons
<?php
if ( ! function_exists( 'prefix_socials_change' ) ) {
/**
* Add/change FORQY Social Icons
*/
function prefix_socials_change( $socials ) {
// Add icon
@pavelrich
pavelrich / functions.php
Last active October 22, 2021 00:04
FORQY — Custom Settings of the jQuery UI Datepicker
<?php
if ( ! function_exists( 'prefix_scripts_datepicker' ) ) {
/**
* Custom Settings of the jQuery UI Datepicker
* @url https://api.jqueryui.com/datepicker/
*/
function prefix_scripts_datepicker() {
@pavelrich
pavelrich / functions.php
Created August 13, 2019 19:03
FORQY — Reservations - Add Custom Metabox
<?php
// Add Custom Metabox to Reservations
if ( ! function_exists( 'forqy_metabox_reservation_custom_register' ) ) {
function forqy_metabox_reservation_custom_register( $meta_boxes ) {
$meta_boxes[] = array(
'id' => 'forqy-metabox-reservation-custom',
@pavelrich
pavelrich / functions.php
Created May 24, 2019 16:47
WordPress — Replace Current Version of the jQuery
<?php
// Replace jQuery Version in a WordPress
if ( ! function_exists( 'forqy_jquery_replace' ) ) {
function forqy_jquery_replace() {
if ( ! is_admin() ) {