<?php
//Instanciando uma nova query sem parâmetros
$query = new WP_Query($args);
//Definindo o título que será base para o filtro
$titulo = "Meu Título";
$array = array();
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Enter the plugin name that you want to clone" | |
read plugin | |
echo "Enter the branch name that you want to select" | |
read branch | |
rm -rf /users/adriano/toolset/$plugin | |
if [ "$plugin" == "toolset-packager" ]; then | |
git clone -b $branch ssh://git@git.onthegosystems.com:10022/layouts-themes/$plugin.git /users/adriano/toolset/$plugin | |
else | |
git clone -b $branch ssh://git@git.onthegosystems.com:10022/toolset/$plugin.git /users/adriano/toolset/$plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This snippet will change the map zoom if a particular marker is present. | |
* Used here: https://wp-types.com/forums/topic/change-what-a-map-shows-when-there-are-no-search-results/#post-374619 | |
*/ | |
jQuery( document ).on( 'js_event_wpv_addon_maps_init_map_started', function( event, data ) { | |
if (WPViews.view_addon_maps.maps_data[0].markers[0].marker == 'marker-123'){ | |
data.map_options.single_zoom = 1; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This will set the historyP to 1 in the View ID 25. So when you filter something in the parametric search | |
* it will work just fine | |
* | |
* Used here: https://wp-types.com/forums/topic/pagination-scroll-transition-direction-is-incorrect/#post-374741 | |
*/ | |
jQuery( document ).on( 'js_event_wpv_parametric_search_triggered', function( event, data ) { | |
WPViews.view_pagination.historyP[25] = 1; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This will let Layouts work with Beaver page builder | |
* This will let you add Beaver elements in cell that contains post body | |
* Without this workaround it will display the Beaver elements on every cell because of the_content() | |
*/ | |
add_action( 'init', 'fix_beaver' ); | |
function fix_beaver(){ | |
$has_been_removed = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This will let you add a custom event for your notification | |
* If the custom field is equal today the notification will be triggered | |
*/ | |
add_filter( 'cred_notification_event_type', 'my_custom_event_type', 99, 4); | |
function my_custom_event_type($notification_type, $form_id){ | |
if( $form_id == '123' ) | |
return 'data_custom_field'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
var theRequest = function(i){ | |
request('http://site.com/?page=' + i, function( err, res, body ) { | |
console.log('Finalizado ' + i); | |
}); | |
} | |
for (var i = 0; i <= 1000; i++) { | |
theRequest(i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
var async = require('async'); | |
var q = async.queue(function(task, callback){ | |
request('http://site.com/?page=' + task.index, function( err, res, body ) { | |
console.log('Finalizado ' + i); | |
callback(); | |
}); | |
}, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This code retrieves course data from an external API and displays it in the user's | |
* My Account area. A merchant has noticed that there's a delay when loading the page. | |
* 1) What changes would you suggest to reduce or remove that delay? | |
* 2) Is there any other code changes that you would make? | |
*/ | |
public function add_my_courses_section() { | |
$api_user_id = get_user_meta( get_current_user_id(), '_external_api_user_id', true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LinkedList() { | |
this.head = null; | |
this.tail = null; | |
} | |
function Node( prev, next, value ) { | |
this.prev = prev; | |
this.next = next; | |
this.value = value; | |
} |
OlderNewer