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
// Settings in here override those in "Default/Preferences.sublime-settings", and | |
// are overridden in turn by file type specific settings. | |
{ | |
"auto_complete_commit_on_tab": true, | |
"auto_indent": true, | |
"bold_folder_labels": true, | |
"caret_style": "phase", | |
"create_window_at_startup": 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
/* | |
* Copyright 2016 | |
* Mathis Rosenhauer | |
* | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* |
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
echo apply_filters( 'the_content', get_post_field('post_content', $my_postid ) ); |
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
// Modifica o html do video embebedado para ficar responsivo | |
add_filter( 'embed_oembed_html','oembed_result', 10, 3 ); | |
function oembed_result( $html, $url, $args ) { | |
if( strstr( $url, 'youtu' ) ){ | |
$video_pattern = '~(?:http|https|)(?::\/\/|)(?:www.|)(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[a-z0-9;:@#?&%=+\/\$_.-]*~i'; | |
$video_id = ( preg_replace( $video_pattern, '$1', $url ) ); | |
$html = '<div class="video-container"><iframe src="https://www.youtube.com/embed/' . $video_id . '" frameborder="0" allowfullscreen'; | |
foreach ( $args as $key => $value ) { |
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
// custom shortcode [a href="http://www.google.com" onclick="test()" rel="nofollow" title="Click here" name="link"]Click me[/a] | |
function ahref_func($atts, $content=null) { | |
extract( shortcode_atts( array( | |
'href' => '', | |
'onclick' => '', | |
'rel' => '', | |
'title' => '', | |
'class' => '', | |
'name' => '' | |
), $atts )); |
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
// Modificando o nome dos Posts para Produtos | |
function mg_change_post_menu_label() { | |
global $menu; | |
global $submenu; | |
$menu[5][0] = 'Produtos'; | |
$submenu['edit.php'][5][0] = 'Produtos'; | |
$submenu['edit.php'][10][0] = 'Adicionar produto'; | |
} | |
function mg_change_post_object_label() { |
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
if( function_exists('acf_add_options_page') ) { | |
$args = array( | |
'page_title' => 'Opções', | |
/* (string) The title displayed in the wp-admin sidebar. Defaults to page_title */ | |
'menu_title' => '', | |
/* (string) The slug name to refer to this menu by (should be unique for this menu). | |
Defaults to a url friendly version of menu_slug */ | |
'menu_slug' => '', |
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
// Alterando o texto da blank line do Contact form 7 | |
function my_wpcf7_form_elements($html) { | |
$text = 'Selecione o departamento'; | |
$html = str_replace('<option value="">---</option>', '<option value="">' . $text . '</option>', $html); | |
return $html; | |
} | |
add_filter('wpcf7_form_elements', 'my_wpcf7_form_elements'); |