Skip to content

Instantly share code, notes, and snippets.

@RadGH
RadGH / wicked-folder-set-folder-attachment_upload.php
Created June 6, 2019 00:05
Assign folder to an uploaded attachment with Wicked Folders using PHP
<?php
/**
* Adds an object to the given folder name.
*
* @param $object_id
* @param $folder_name
* @param $parent_folder_id
*
* @return bool
@amboutwe
amboutwe / yoast_seo_opengraph_change_image_size.php
Last active October 28, 2024 06:15
Code snippet to change or remove OpenGraph output in Yoast SEO. There are multiple snippets in this code.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change size for Yoast SEO OpenGraph image for all content
* Credit: Yoast Development team
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail'
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/
*/
@aderaaij
aderaaij / yoast
Last active February 7, 2025 14:26
Wordpress - Move yoast seo boxes to bottom of post/page
// Move Yoast to bottom
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
@justinwalsh
justinwalsh / rekey_multi_array.php
Created November 4, 2011 17:28
PHP function to rekey or index a multidimensional array and preserve associative keys
<?php
function rekey_multi_array($array) {
$new = array();
$count = 0;
if (is_array($array)) {
foreach ($array as $key => $val) {
if (!is_numeric($key)) {
$new[$key] = $this -> rekey_multi_array($val);
} else {
$new[$count] = $this -> rekey_multi_array($val);