Skip to content

Instantly share code, notes, and snippets.

View silvaitamar's full-sized avatar
🤝

Itamar Silva silvaitamar

🤝
View GitHub Profile
@silvaitamar
silvaitamar / copy-cutom-post-type-tags.php
Created May 22, 2024 07:53
Função para copiar as tags associadas aos posts de um tipo customizado para uma nova taxonomia customizada
<?php
/**
* Function to copy tags associated with custom post type to the new custom taxonomy "tag-recurso-educativo".
*/
function copy_custom_post_type_tags() {
// Set arguments to retrieve custom post type posts.
$args = array(
'post_type' => 'recursos-educativos', // Replace 'recursos-educativos' with your custom post type name.
'posts_per_page' => -1,
);
@silvaitamar
silvaitamar / copy-custom-post-type-categories.php
Last active May 22, 2024 07:54
Função para copiar as categorias associadas aos posts de um tipo customizado para uma nova taxonomia customizada
<?php
/**
* Function to copy categories associated with custom post type to the new custom taxonomy "taxonomy-slug".
*/
function copy_custom_post_type_categories() {
// Set arguments to retrieve custom post type posts.
$args = array(
'post_type' => 'post-type-slug', // Replace 'post-type-slug' with your custom post type name.
'posts_per_page' => -1,
);
@silvaitamar
silvaitamar / filters.php
Created October 11, 2023 22:43 — forked from webprom/filters.php
WordPress Gutenberg Query Loop View More AJAX
<?php
/**
* Add data attributes to the query block to describe the block query.
*
* @param string $block_content Default query content.
* @param array $block Parsed block.
* @return string
*/
function query_render_block( $block_content, $block ) {
if ( 'core/query' === $block['blockName'] ) {
@silvaitamar
silvaitamar / MySqlBackup.bat
Created July 1, 2020 05:43 — forked from adityasatrio/MySqlBackup.bat
Mysql Backup Script For Windows
@echo off
set dbUser=root
set dbPassword=password
set backupDir="F:\AdityaSatrioNugroho\testbackupDb-bat\"
set mysqldump="C:\xampp\mysql\bin\mysqldump.exe"
set mysqlDataDir="C:\xampp\mysql\data"
set zip="C:\Program Files\7-Zip\7z.exe"
:: get date
@silvaitamar
silvaitamar / bootstrap carousel with multiple items - wordpress
Created December 3, 2018 23:32 — forked from hasanm95/bootstrap carousel with multiple items - wordpress
bootstrap carousel with multiple items in wordpress/ custom post / cmb2( Group field)