Skip to content

Instantly share code, notes, and snippets.

Avatar

wpsumo wpsumo

  • Switzerland
View GitHub Profile
@swinggraphics
swinggraphics / oxy-save-rendered-content.php
Last active Nov 19, 2020
Copy compiled Oxygen page content to post_content for search
View oxy-save-rendered-content.php
/* Copy compiled Oxygen page content to post_content for search */
function sg_save_rendered_page_content( $meta_id, $object_id, $meta_key, $meta_value ) {
// Debugging
// $debug .= preg_replace( '#(\[/[^\]]+?\])#', "$1\n", $meta_value );
// file_put_contents( plugin_dir_path( __FILE__ ) . 'debug.html', $debug );
if ( 'ct_builder_shortcodes' != $meta_key ) return;
// Don't try to render anything with inner content
if ( false !== strpos( $meta_value, '[ct_inner_content' ) ) return;
@ERROPiX
ERROPiX / oxy-cm-theme.scss
Created Sep 21, 2020
An Advanced Scripts snippet to enhance the Oxygen code editor theme
View oxy-cm-theme.scss
/*
Title: Oxygen Code Editor Theme
Type: CSS > Compile SCSS Code
Location: Custom Hooks
Hook name: oxygen_enqueue_ui_scripts
Priority: 10
*/
#oxygen-ui {
.cm-s-default {
@hnq90
hnq90 / functions.php
Created Jan 11, 2018 — forked from yoren/functions.php
Parent Post From Another Post Type And A New URL Structure In WordPress
View functions.php
<?php
// Flush rewrite rules after switch theme
function my_rewrite_flush() {
flush_rewrite_rules();
}
add_action( 'after_switch_theme', 'my_rewrite_flush' );
// A little help so we can get the stylesheet from parent theme
// Remove line 10-19 if this is not a child theme
function my_enqueue_styles() {
@gyrus
gyrus / preload-images.js
Last active Nov 2, 2020
WordPress image preloading
View preload-images.js
/**
* Image preloader
*
* @link http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript
*/
var cache = [];
// Arguments are image paths relative to the current page.
function pilau_preload_images() {
var args_len, i, cache_image;
args_len = arguments.length;
You can’t perform that action at this time.