Skip to content

Instantly share code, notes, and snippets.

View igorveremsky's full-sized avatar
🇺🇦
#standwithukraine

Igor Veremsky igorveremsky

🇺🇦
#standwithukraine
View GitHub Profile
@igorveremsky
igorveremsky / functions.php
Last active October 6, 2017 12:41
Duplicate Posts and Pages in Wordpress
<?php
/*
* Function creates post duplicate as a draft and redirects then to the edit post screen
*/
function iv_duplicate_post_as_draft(){
global $wpdb;
if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'iv_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) {
wp_die('No post to duplicate has been supplied!');
}
@igorveremsky
igorveremsky / admin-custom.css
Last active January 16, 2018 14:04
Enable SVG support in Wordpress
.wp-core-ui .attachment .thumbnail .svg-centered {
-webkit-transform: translate(0,0) !important;
-ms-transform: translate(0,0) !important;
transform: translate(0,0) !important;
}
.wp-core-ui .attachment .thumbnail .svg-centered svg {
width: 100%;
height: calc(100% - 1.4em - 10px);
}
#postimagediv .inside img[src$=".svg"] { width: 100% !important; height: auto !important;}