Skip to content

Instantly share code, notes, and snippets.

@davilera
Last active January 30, 2017 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davilera/4c1e59e384bd89a4e784aef2a6f5c2bf to your computer and use it in GitHub Desktop.
Save davilera/4c1e59e384bd89a4e784aef2a6f5c2bf to your computer and use it in GitHub Desktop.
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