idealbrandon
Forum Replies Created
-
Forum: Plugins
In reply to: [WP User Profiles] select2 fields on profile pages do not workWell, this is a bigger issue.
I ran the admin_enqueue_scripts action to dump the necessary scripts (kind of absurd that you aren’t enqueuing admin scripts by default, by the way), but this is still broken.
I am going to dig through your user-profile.js file and figure out where the conflict is, unless you can point me in the right direction
Forum: Plugins
In reply to: [WP User Profiles] select2 fields on profile pages do not workSo, the problem here is that when other plugins enqueue scripts on profile.php, they are not getting enqueued on your user.php screen.
Is there an easy solution for this?
Forum: Developing with WordPress
In reply to: wp_enqueue_script was called incorrectlyUGH.
I solved this. I’m an idiot. I had a file in my theme named admin.php that was setting up wp-admin handlers and the like for a portion of my application.
I was including this via
include_once( 'admin.php' )from its parent file, and apparently that was calling the main wp-core admin.php file. So yeah. Hours of debugging because I didn’t specify an absolute path. smh.Forum: Developing with WordPress
In reply to: wp_enqueue_script was called incorrectlyYes. As I said, I’ve completely removed every single reference to and script or style and any enqueue, and I’m still getting this error. No plugins loaded, and the theme is 100% coded by me. I’m used a global search and replace to ensure that I’m loading nothing, and have even checked the dev tools in the admin to see if there is anything random been loaded that I was (somehow) unaware of. Nothing.
Forum: Developing with WordPress
In reply to: Conditional Widgets based on sidebarSo! Just as an update for anyone who may be interested in doing the same thing as me, this is relatively simply.
Basically, I needed to know the ID of a given widgets parent widget area. To achieve this, inside the widget() function (in the WP_Widget class) I did the following:
$this_widget_id = $args['widget_id']; $all_widgets = wp_get_sidebars_widgets(); $this_widget_area_id; foreach ( $all_widgets as $widget_area => $widget_ids ) { foreach ( $widget_ids as $widget_order => $widget_id ) { if ( $widget_id == $this_widget_id ) $this_widget_area_id = $widget_area; } }This allows me to conditionally target pieces of a widget based on the widgets location.
EDIT While this technically solves the problem, it uses the private WP function wp_get_sidebars_widgets() to do so. I’ll find a solution that doesn’t use a private function instead.
- This reply was modified 9 years, 2 months ago by idealbrandon.
Forum: Developing with WordPress
In reply to: Conditional Widgets based on sidebarThanks for sending me that direction … It doesn’t quite do what I need it to do, as I am not trying to conditional hide the widget, per se. Rather, I’m trying to hide pieces OF the widget based on its context …
I am currently exploring
wp_get_sidebars_widgets()as it contains all of the active sidebars with their respective widgets by ID, so I should be able to compare IDs and grab the widget area from there.Thanks again
Forum: Fixing WordPress
In reply to: Header image being repeatedmy image did not work, so it can be found at this address.. Image