This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $slider = $('#slider'), | |
slideSettings = [ | |
{ timeout: 2000, fx: 'fade' }, | |
{ timeout: 3000, fx: 'scrollHorz' }, | |
{ timeout: 3000, fx: 'scrollVert' }, | |
{ timeout: 6000, fx: 'scrollUp' } | |
], | |
slideTransitions = slideSettings[0].fx; | |
$.each(slideSettings, function(index, settings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Exempel: Temascript som använder sig av WP:s bundlade Backbone.js | |
wp_enqueue_script( | |
'my-app', | |
get_template_directory_uri() . '/js/app.js', | |
array( 'backbone' ) | |
); | |
// Handle för Underscore.js är föga förvånande 'underscore' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( | |
'edit_form_after_title', | |
function() | |
{ | |
global $post; | |
if ( 'wg_slider' != $post->post_type ) | |
{ | |
// Vi vill bara visa hjälptexten vid redigering av vår CPT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ./wp-includes/ms-default-filters.php, line 48 | |
add_action( 'upload_ui_over_quota', 'multisite_over_quota_message' ); | |
// ./wp-admin/includes/media.php, line 2256-2263 | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// functions.php | |
// Ta bort standardpanelen… | |
remove_action( 'welcome_panel', 'wp_welcome_panel' ); | |
// …och lägg till vår egen! | |
add_action( 'welcome_panel', function () | |
{ | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Någonstans i din pluginfil… | |
add_action( 'restrict_manage_users', function () | |
{ | |
// Inline-CSS är inte snyggt, men för demonstrationen använder vi det här. | |
// Utan denna CSS-kod placeras vår selectbox fel. | |
?> | |
<select name="my-temp-filter" style="float:none;"> | |
<option>Vårt filterelement</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'parse_query', 'wp_parse_query' ); | |
function wg_parse_query( $query ) | |
{ | |
global $typenow, $pagenow; | |
if ( ! is_admin() || $typenow !== 'my_post_type' || $pagenow !== 'edit.php' ) | |
{ | |
// Se till att vi ändrar query:n vid rätt tillfälle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
button, | |
input[type=text], | |
input[type=submit], | |
textarea { | |
-webkit-appearance: none; | |
-webkit-border-radius: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Tar bort den transient som genererats för postlistan med | |
* alfabetisk paginering. | |
* | |
* @wp-hook save_post,before_delete_post | |
* @param int $post_id ID på posten som sparas/raderas | |
*/ | |
function wg_clear_postlist_cache( $post_id ) |
OlderNewer