Skip to content

Instantly share code, notes, and snippets.

@djoo
djoo / elementor_global_colors_to_tinymce4_and_gutenberg-options.php
Last active June 12, 2024 14:09
Elementor Global Colors To TinyMCE WordPress and Gutemberg
<?php
// Function to get Elementor colors
function get_elementor_colors() {
// For exporting global settings
$default_post_id = get_option('elementor_active_kit');
$global_data = get_post_meta($default_post_id, '_elementor_page_settings', true);
$colors = [];
@djoo
djoo / Elementor Grid CSS
Created February 29, 2024 17:13
elementor-grid.css
/*para desktop*/
@media (min-width: 1025px) {
:root {
--columns: 12;
--width: 1140px;
--offset: 0px;
--gutter: 20px;
--color: #f90fba14;
}
@djoo
djoo / link_post_translation.php
Last active August 26, 2024 13:10
WPML Custom end point link 2 existing translation
<?php
/**
* Link the FR translation and the EN translation
* Called by API https://domain.com/wp-json/link_translation/post/
*/
function custom_rest_link_translation($data) {
//Source https://wpml.org/wpml-hook/wpml_set_element_language_details/
@djoo
djoo / gist:e0d60a3415c1f48dfe7ffc7cdbe08b66
Created February 3, 2021 19:24
Zoho deluge Import Media Wordpress Library
downloadPhoto1 = invokeurl
[
url: "https://media-cdn.tripadvisor.com/media/photo-s/0f/49/47/99/chambre-case-plage.jpg"
type: GET
];
//Ajout de la photo dans une liste
files = List();
downloadPhoto1.setParamName("file");
files.add(downloadPhoto1);
@djoo
djoo / gist:65a6237c312b2109d9f10f952eb221c0
Created February 3, 2021 19:22
Zoho Deluge to Wordpress Post
create_produit_CMS = invokeurl
[
url :apiWpUrlEndpointPost
type :POST
parameters:data.toString()
connection:"wpconnextion"
content-type:"application/json"
];
//Affichage des erreurs
responseData = create_produit_CMS.get("data");
#! /usr/bin/env bash
find -E '/Users/Johann/Desktop/ResizeGoogle' -type f -iregex '.*\.(JPG|JPEG|PNG|TIF|TIFF)$' |\
while read FULL_IMAGE_PATH
do
convert -density 72 -units PixelsPerInch -resize "2000x2000>" -quality 90 "${FULL_IMAGE_PATH}" "${FULL_IMAGE_PATH}"
done
####### WINDOWS #######
#! /usr/bin/env bash
find -E '/Users/Johann/Desktop/ResizeBlog2' -type f -iregex '.*\.(JPG|JPEG|PNG|TIF|TIFF)$' |\
while read FULL_IMAGE_PATH
do
convert -density 72 -units PixelsPerInch -resize "1200x1200>" -quality 90 "${FULL_IMAGE_PATH}" "${FULL_IMAGE_PATH}"
composite -compose atop -geometry +15 -gravity southwest ./watermark-photos.png "${FULL_IMAGE_PATH}" "${FULL_IMAGE_PATH}"
done
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- page_head.tpl -->
@djoo
djoo / content.ini.append.php
Last active August 29, 2015 14:02
eZ Publish 5 Add "onclick" attribute to "link" element
[link]
CustomAttributes[]
CustomAttributes[]=onclick
@djoo
djoo / ContentViewEmbedController.php
Created May 30, 2014 13:57
Override content view embed link in eZ Publish 5
<?php
/**
* File containing the FooterController class.
*
* @copyright Copyright (C) 1999-2014 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
*/