Skip to content

Instantly share code, notes, and snippets.

@davilera davilera/00-evil-wordpress.md Secret
Last active Jan 30, 2017

Embed
What would you like to do?
Cómo hacer el mal en WordPress

Snippets from my talk: Cómo hacer el mal en WordPress

:after, :before, * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.row:before, .row:after {
display: table;
content: " ";
clear: both;
}
.margin-bottom {
margin-bottom: 10px;
}
.no-margin {
margin: 0;
}
.row:before, .row:after {
display: table !important;
content: " " !important;
clear: both !important;
}
.margin-bottom {
margin-bottom: 10px !important;
}
.no-margin {
margin: 0 !important;
}
:after, :before, * {
font-family: "Comic Sans" !important;
}
<?php
// ...
wp_enqueue_script(
$this->plugin_name,
NELIO_CONTENT_ADMIN_URL . '/js/admin.min.js',
array( 'jquery', 'backbone', /* ... */ ),
$this->version,
false
);
<?php
// ...
?>
<script type="text/javascript" src="<?php
echo esc_url( PLUGIN_ADMIN_URL . '/lib/js/jquery.min.js' );
?>"></script>
<?php
// ...
<?php
function evil_fix_scripts() {
wp_deregister_script( 'jquery' );
}//end evil_fix_scripts()
add_action( 'wp_enqueue_scripts', 'evil_fix_scripts', 1 );
<?php
// ...
if ( $this->is_current_screen( '...certain-page...' ) ) {
wp_enqueue_script(
$this->plugin_name,
NELIO_CONTENT_ADMIN_URL . '/js/admin.min.js',
array( 'jquery', 'backbone', /* ... */ ),
$this->version,
false
);
}//end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.