Skip to content

Instantly share code, notes, and snippets.

View brojask's full-sized avatar

Hello World! Here's brojask

View GitHub Profile
<?php
function cwc_viewpdf($attr, $url) {
return '<iframe src="http://docs.google.com/viewer?url=' . $url . '&embedded=true" style="width:' .$attr['width']. '; height:' .$attr['height']. ';" frameborder="0">Your browser should support iFrame to view this PDF document</iframe>';
}
add_shortcode('embedpdf', 'cwc_viewpdf');
@brojask
brojask / custom-search-acf-wordpress.php
Created June 7, 2016 05:42 — forked from charleslouis/custom-search-acf-wordpress.php
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
var defaults = {
number: 1,
bool: true,
magic: 'real',
animal: 'whale',
croutons: 'delicious'
};
var options = {
number: 2,
<script>
// 1. Habilitar clic derecho
(function (d) {
d.oncontextmenu = function () {
return true;
};
d.addEventListener("click", function () {
console.log("El clic derecho regresó...");
});
})(document);
<?php
add_action('admin_init', function () {
// register a new setting for "wporg" page
register_setting('wporg', 'wporg_options');
// register a new section in the "wporg" page
add_settings_section(
'wporg_section_developers',
__('The Matrix has you.', 'wporg'),