View cloneRole.php
<?php | |
add_action('init', 'cloneRole'); | |
function cloneRole() | |
{ | |
global $wp_roles; | |
if ( ! isset( $wp_roles ) ) | |
$wp_roles = new WP_Roles(); | |
$adm = $wp_roles->get_role('administrator'); |
View wp_query_all.php
$query = new WP_Query( array( | |
'post_type' => array('salplesk_profili','salplesk_aziende','salplesk_offerte'), | |
'posts_per_page' => -1, | |
'fields' => 'ids' | |
) ); |
View WP_Query.php
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
View custom_tax.php
<?php | |
$id = get_the_ID(); | |
$taxonomy = 'your-taxonomy'; | |
$terms = get_the_terms( $id, $taxonomy ); | |
foreach ($terms as $term) { | |
// Here you can display the terms how you want | |
echo 'TERM: '.$term->name; |
View media-lib-resolution-column.php
add_filter('manage_upload_columns', 'size_column_register'); | |
function size_column_register($columns) { | |
$columns['dimensions'] = 'Dimensions'; | |
return $columns; | |
} | |
add_action('manage_media_custom_column', 'size_column_display', 10, 2); |
View apik_acf.php
<?php | |
function fix_gmaps_api_key() { | |
if(mb_strlen(acf_get_setting("google_api_key")) <= 0){ | |
acf_update_setting("google_api_key", "AIzaSyDXiH2aFtmW-8TYE2Tyll702wwlwyOsEZQ"); | |
} | |
} | |
add_action( 'admin_enqueue_scripts', 'fix_gmaps_api_key' ); |
View .htaccess
RewriteEngine on | |
#eccezioni pagine specifiche | |
RewriteCond %{REQUEST_URI} !/catalogues | |
RewriteCond %{REQUEST_URI} !/gallery-parquet-pavimenti-legno | |
RewriteCond %{REQUEST_URI} !/parquet/natural-wood-floor/types-of-wood | |
RewriteCond %{REQUEST_URI} !/parquet/natural-wood-floor/antico-asolo-3-ply | |
RewriteCond %{REQUEST_URI} !/parquet/natural-wood-floor/antico-asolo-2-ply | |
RewriteCond %{REQUEST_URI} !/parquet/natural-wood-floor/parquet-mosaici-dasolo | |
RewriteCond %{REQUEST_URI} !/contacts |
View ajax.js
(function($) { | |
$('#form_tesseramento #ek_province').on('change', function(){ | |
var provincia_id = $(this).val(); | |
console.log(provincia_id); | |
jQuery.ajax({ | |
url : postdata.ajax_url, //definito riga 8 precedente script | |
type : 'post', | |
data : { | |
action : 'ek_skipay_getComuneByProvincia', //function ajax da richiamare | |
provincia_id : provincia_id //dato da passare, in questo caso id estratto da option selezionata |
View conversione_data.php
<?php | |
//perchè funzioni strtotime è necessario sostituire / con - | |
$data = strtotime(str_replace('/', '-' ,$_POST['data_nascita_cliente']); | |
//ottengo il formato richiesto | |
$data_nascita_cliente = date('Y-m-d', $data)); |
View redirectWP.php
<?php | |
// *F001* filtro per permettere il redirect | |
//allow redirection, even if your theme starts to send output to the browser | |
add_action('init', 'clean_output_buffer'); | |
function clean_output_buffer() { | |
ob_start(); | |
} |
OlderNewer