William Earnhardt
Forum Replies Created
-
Forum: Plugins
In reply to: [Gutenberg] Can,t find custom fields in Gutenberg editorYes, it’s something that should be ready before Gutenberg becomes part of WordPress core.
Forum: Plugins
In reply to: [Gutenberg] Can,t find custom fields in Gutenberg editorThis is something we’re working on right now. You can track progress here:
https://github.com/WordPress/gutenberg/issues/3228Forum: Plugins
In reply to: [The Events Calendar] Support for Domain Mapping???Thanks @barryhughes-1! I didn’t know about that repo. I’ll definitely make a pull request there!
@althe3rd, I reported a slightly different issue before related to https, but still resolving around using these constants. Actually looking at the repo Barry linked above, I now see it was just never actually fixed correctly and I had just kept my instance patched against it. But I updated to the latest version this time and overwrote my patch again, causing it to break.
FWIW, it looks like they fixed it in EC 4.4, but then broke it again in EC 4.5.10.
I first reported it almost 11 months ago and advised against the constants then:
https://wordpress.org/support/topic/use-of-wp_content_url-breaks-plugin-on-admin-ssl-only-sites/Here is a commit from last December where they temporarily fixed a regression on HTTPS due to use of the constant:
https://github.com/moderntribe/tribe-common/commit/e7a69fb6d5966e9b9e0069c0f03303d4948f7e6a#diff-55769dfdd1ff4f3ddbdb7aa3cf37088cThen they broke it when adding support for mu-plugins by re-adding the constants here:
https://github.com/moderntribe/tribe-common/commit/3083c47dec8241e65041c3891d5c7fb3aa559a6f#diff-55769dfdd1ff4f3ddbdb7aa3cf37088cAnd then they updated it to fix the https admin/http front-end issue by wrapping it in
set_url_scheme()
calls about a month ago, but still used the constants.
https://github.com/moderntribe/tribe-common/commit/3d7aedf8c198b5e623225a996e9078954c11ffd2#diff-55769dfdd1ff4f3ddbdb7aa3cf37088cAnyway…pull request incoming!
Forum: Plugins
In reply to: [The Events Calendar] Support for Domain Mapping???BTW, I just forked the plugin to fix this. Essentially exact same thing I did ~9 months ago and warned about then.
In common/src/Tribe/Assets.php
Replace line 219-220:
$wp_plugin_url = set_url_scheme( WP_PLUGIN_URL ); $wp_content_url = set_url_scheme( WP_CONTENT_URL );
with:
$wp_plugin_url = set_url_scheme( plugins_url() ); $wp_content_url = set_url_scheme( content_url() );
Forum: Plugins
In reply to: [The Events Calendar] Support for Domain Mapping???Bumping this, as it’s a major regression.
I’m still troubleshooting to determine the specific issue, but I think it’s because of the use of the WP_PLUGIN_URL and WP_CONTENT_URL constants. The Codex explicitly say not to use these:
WordPress makes use of the following constants when determining the path to the content and plugin directories. These should not be used directly by plugins or themes, but are listed here for completeness.
WP_CONTENT_DIR // no trailing slash, full paths only WP_CONTENT_URL // full url WP_PLUGIN_DIR // full path, no trailing slash WP_PLUGIN_URL // full url, no trailing slash
Source: https://codex.wordpress.org/Determining_Plugin_and_Content_Directories
I’ve brought this up in the past related to setups that use mixed http/https environments. There are perfectly good functions that prevent these types of issues. Use those instead of trying to recreate parts of them every time you need one of the constants.
This is not fixed in the most recent versions.
You are still using
WP_CONTENT_URL
instead ofcontent_url()
. I’m not sure how I can be more clear in how easy it is to fix this bug for everyone.Forum: Plugins
In reply to: [The Events Calendar] wp-admin SSL loads resources httpThis happens when you force admin SSL, but not SSL on the front end. I had the same problem. It is because they changed the way they generate the asset URLs.
They now use the
WP_CONTENT_URL
constant, which interestingly enough, the codex say explicitly not to use (probably for reasons like this). See: https://codex.wordpress.org/Determining_Plugin_and_Content_DirectoriesFortunately there is a filter on the return of the
tribe_resource_url()
function, so you can fix it like this:add_filter( 'tribe_resource_url', 'fix_tribe_resource_url', 10, 2 ); function fix_tribe_resource_url( $url, $resource ) { if ( is_ssl() ) { $url = str_replace( 'http', 'https', $url ); } return $url; }
Forum: Plugins
In reply to: [Easy Bootstrap Shortcode] Toggles Shortcode default classAny update for this? We ran into this issue this morning. Would love to have a fix upstream and not have to patch our version.
Thanks!
Forum: Plugins
In reply to: [List category posts] After upgrade Posts not showing, only parameters.Active Plugins are stored as a serialized array in the options table of
array( 'plugin-directory/plugin-file-name.php' )
So if you change the name of the primary plugin file, it will deactivate the plugin because it thinks it no longer exists. You really shouldn’t change the plugin directory name or the primary file name on updates.
I wouldn’t change it back now that you’ve done it, because it will deactivate everyone again. Just avoid that in the future with this or other plugins.
Forum: Everything else WordPress
In reply to: Developing an University Website on WordPressI’m the lead developer of ITS Web Services at UNC Chapel Hill. We run two WordPress multisite networks that serve our ~30,000 students and ~10,000 faculty and staff.
One network is open in the style of WordPress.com. Anyone with a valid university login can go create a site at web.unc.edu. We now have almost 10,000 sites on this network.
The other network houses many of our larger university websites (ex: http://www.unc.edu/, http://events.unc.edu/, http://its.unc.edu/, http://hr.unc.edu/, http://registrar.unc.edu/, http://advising.unc.edu/) as well as numerous departments (example: http://cs.unc.edu/, http://marine.unc.edu/, etc) and even schools (http://sph.unc.edu/).
So if the question is can you use WordPress for a site that serves thousands of students and staff? Absolutely!
Strictly talking pros/cons…here’s a couple I can think of offhand.
Pros of WP over Sharepoint:- WordPress will have a shallower learning curve for your authors/editors/publishers of content.
- It will be significantly easier to do custom theming/development for WordPress.(having done both, it’s not even a comparison)
Cons:
- User permissions in WordPress are pretty rudimentary. They are fine for many use cases, but if you need fine granular control over specific groups of content, then Sharepoint will win any day of the week.
- As a file repository, WP is just ok. Again, Sharepoint gives you lots of granular controls that would make it better for that purpose.
I find that Sharepoint tends to be better for internal facing intranet type sites where you need a very particular permissions scheme and integration with Active Directory.
WordPress excels in web publishing, but it can be used for any number of things.
If you have any specific questions, I’m happy to answer them. Feel free to email me at earnhardt at unc dot edu.
Forum: Fixing WordPress
In reply to: Custom Fields and menu itemsActually, where is that
add_filter()
call located? Is it in a functions.php file for a theme? Is it in a plugin?Forum: Fixing WordPress
In reply to: Custom Fields and menu itemsHmm, after looking at this a little more, seems like
the_title
should be working. It looks like it usesget_the_title()
which is filtered bythe_title
.The wp-admin/nav-menu.php code is all over the place though, so it’s kinda hard to follow.
Forum: Fixing WordPress
In reply to: Custom Fields and menu itemsTry adding another hook on the filter
nav_menu_attr_title
to fire the same function you use on the front-end and see if that works for you.Forum: Fixing WordPress
In reply to: Custom Fields and menu itemsNot sure how it adds the label to the title when you’re hooking in to
the_content
filter. I believe that should be only filtering onpost_content
field and notpost_title
Ok, figured it out. It’s a bug with WordPress MU Domain Mapping in that it filters
get_option( 'home' )
which is used by core to determine whether thewordpress_logged_in_
cookie should be secure only based on the protocol stored in the database.The plugin just uses
is_ssl()
, so it messes with sites that are only SSL on the admin side.You can add an action on
pre_option_home
andpre_option_siteurl
that fires after the one from the domain mapping plugin and corrects the protocol to fix the problem (as well as issues with images inserted in posts, etc.)I’ll send a note to the maintainers of the plugin too so it will get patched there.