Skip to content

Showing User’s „custom POst Types“ instead of just regular „posts“ in the Admin’s User table

add_action('manage_users_columns','yoursite_manage_users_columns'); function yoursite_manage_users_columns($column_headers) { unset($column_headers['posts']); $column_headers['custom_posts'] = 'Assets'; return $column_headers; } add_action('manage_users_custom_column','yoursite_manage_users_custom_column',10,3); function yoursite_manage_users_custom_column($custom_column,$column_name,$user_id) { if ($column_name=='custom_posts') { $counts = _yoursite_get_author_post_type_counts(); $custom_column = array(); if (isset($counts[$user_id]) && is_array($counts[$user_id])) foreach($counts[$user_id] as $count) { $link = admin_url() . "edit.php?post_type=" . $count['type']. "&author=".$user_id;…

Mehr Lesen

WooCommerce: Apply Coupon COde via URL Parameter

Use like this: https://examplestore.com/?coupon_code=5dollarOff function webroom_woocommerce_coupon_links(){ // Bail if WooCommerce or sessions aren't available. if (!function_exists('WC') || !WC()->session) { return; } /** * Filter the coupon code query variable name. * * @since 1.0.0 * * @param string $query_var Query…

Mehr Lesen

Logged In and Logged Out Shortcodes

Just encapsulate the content you want to show only to logged in users or or only to logged out users like this: [loggedin]Visible for logged in users only[/loggedin] [loggedout]Visible for guests only[/loggedout] The Code for the two shortcodes //logged in…

Mehr Lesen

Zoom images on Scroll CSS Only

@keyframes scale-a-lil { from { scale: .5; } } @media (prefers-reduced-motion: no-preference) { figure img { animation: scale-a-lil linear both; animation-timeline: view(); animation-range: 25vh 75vh; } } https://codepen.io/argyleink/pen/RwvOmvY https://tympanus.net/codrops/2024/01/17/a-practical-introduction-to-scroll-driven-animations-with-css-scroll-and-view/

Mehr Lesen

Top Line Lase Scroll progress Indicator

You want a tiny scroll indicator line on top of the browser window like some of the news outlets have? Add this CSS to your Child Themes style.css /*SCROLL INDICATOR*/ .scroll-watcher { height: 10px; position: fixed; top: 0; left:0; z-index:…

Mehr Lesen

Only Mobile Line Break

Use this CSS to introduce a line break that only works on mobile or small screen devices. @media screen and (min-width: 768px) { .mobile-break { display: none; } } And then use it like this: <br class="mobile-break">

Mehr Lesen

Restrict plugin from activation or deactivation

https://www.youtube.com/watch?v=-jzbgz0bINE Prevent activation (and also auto deactivation) of certain plugins function enym_restrict_plugin_activation() { $restricted_plugins = array('wp-file-manager/file_folder_manager.php', 'file-manager-advanced/file_manager_advanced.php', 'file-manager/file-manager.php', 'fileorganizer/fileorganizer.php', 'filester/ninja-file-manager.php', 'wpide/wpide.php', 'htaccess-file-editor/htaccess-file-editor.php', 'wp-htaccess-editor/wp-htaccess-editor.php'); $active_plugins = get_option( 'active_plugins' ); foreach ( $active_plugins as $plugin ) { if ( in_array( $plugin, $restricted_plugins…

Mehr Lesen
An den Anfang scrollen