Skip to content

Instantly share code, notes, and snippets.

View nikolailehbrink's full-sized avatar

Nikolai Lehbrink nikolailehbrink

View GitHub Profile
@awsm-support
awsm-support / job-functions.php
Created August 30, 2021 09:58
WP Job Openings - Reset Job Views Count
<?php
/**
* NOTE: Please execute this function only once. After resetting the views, remove the whole code snippet.
*/
function awsm_jobs_reset_views_count() {
$args = array(
'post_type' => 'awsm_job_openings',
'post_status' => array( 'publish', 'expired', 'future', 'draft', 'pending' ),
'posts_per_page' => -1,
@techlemur
techlemur / list_blocks.js
Created February 11, 2019 21:19
get all available gutenberg block info for your site with javascript
/* Navigate to a wordpress edit page for any post and run one of the code sections below in a javascript console to get the names/info for all blocks available to gutenberg on your site. */
/* log all block info to console */
console.log(wp.data.select( "core/blocks" ).getBlockTypes());
/* log all block names to console */
wp.data.select( "core/blocks" ).getBlockTypes().forEach(function(element) {
console.log(element['name']);
});