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
/*=================================== | |
= Posts Types = | |
===================================*/ | |
/*========== Exemplo ==========*/ | |
function exemplo() { | |
$args = array( | |
'labels' => array('name' => 'exemplo', 'add_new' => 'Adicionar'), | |
'public' => 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
//Altere isso para true para ativar as opções multisite | |
define( 'WP_ALLOW_MULTISITE', true ); | |
//troca a pasta w-content/uploads | |
define( 'UPLOADS', 'media' ); | |
//definir o tema padrão | |
define( 'WP_DEFAULT_THEME', 'meu-tema' ); | |
//desativar a edição de arquivos via painel |
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
define( 'PLUGIN_PATH', plugin_dir_path(__FILE__)); | |
add_action('template_redirect', 'load_template_pluginname'); | |
function load_template_pluginname(){ | |
global $post; | |
if(get_post_meta($post->ID, 'pluginname_page', true)){ | |
if(locate_template('template-plugin-name.php', 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
jQuery(document).ready(function($){ | |
var custom_uploader; | |
$('#upload_image_button').click(function(e) { | |
e.preventDefault(); | |
if (custom_uploader) { | |
custom_uploader.open(); | |
return; | |
} | |
custom_uploader = wp.media.frames.file_frame = wp.media({ | |
title: 'Escolha a imagem para o banner', |
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
ob_start(); | |
include 'secondfile.php'; | |
$myvar = ob_get_clean(); |
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 | |
/** | |
* Create a new custom yoast seo sitemap | |
*/ | |
add_filter( 'wpseo_sitemap_index', 'ex_add_sitemap_custom_items' ); | |
add_action( 'init', 'init_wpseo_do_sitemap_actions' ); | |
// Add custom index |
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 | |
function produtos() { | |
$args = array( | |
'labels' => array( | |
'name' => 'Produtos', | |
'add_new' => 'Adicionar Produto' | |
), | |
'public' => true, | |
'publicly_queryable' => 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
<?php | |
/*************************************************************************** | |
Plugin Name: Meu Plugin | |
Plugin URI: https://www.meuplugin.com/ | |
Description: Plugin base para iniciar o desenvolvimento | |
Version: 1.0 | |
Author: Claudio Web (claudioweb) | |
Author URI: http://www.claudioweb.com.br/ | |
Text Domain: meu-plugin | |
**************************************************************************/ |
OlderNewer