andrejcremoznik
Forum Replies Created
-
Forum: Plugins
In reply to: [Loco Translate] Writeable permission check doesn’t work correctlyI tracked this down through WP filesystem functions and PHP and found out that
DISALLOW_FILE_MODS
beingtrue
gives these errors.Forum: Developing with WordPress
In reply to: How to i18n the URL slug for built in post type?I’ve done some more testing and it seems I’ve misunderstood this feature for a long while. At best it’s possible to have a translated url slug on a single-lang site. On multilang sites where the $locale is actually dynamic it will never work.
I’ll see what I can do with rewrite rules in WP or server.
Then limit it to your plugin’s settings screen or make it dismissable for people who know what they are doing. I just don’t want it to clutter the screen. Thanks
Forum: Hacks
In reply to: Bringing script/style registering out of the stone ageThis isn’t the right forum for this.
I know. There’s the advanced section that can’t be posted into because mods have an attitude problem.
FYI, your request will be taken more seriously if you lose the attitude.
Good thing you point this out. It reminds me that interaction rules with 12 year old co-players in MOBAs should be applied to the general populace. Apparently nowadays trying to write in an engaging way is seen as insulting.
And if you are refering to the last sentence, be aware that every single thread about unloading WP built-in scripts on frontend is always met with a remark by someone, how it shouldn’t be done. I’m sick of hearing that. People who can just dismiss these topics clearly lack knowledge and real life experince building things.
Now you can call me out on my attitude. TYVM
Yes I’m familiar with everything regarding script loading in WP. I’ve also read this and I understand the reasoning why Give and plugins in general handle things in a certain way.
The way I’m using WP is as a framework + CMS. Frontend is completely customized. Dependencies (plugins) are handled with Composer, Bower for frontent libs, and Grunt for building (including script concatenation and minification) and deploying. For more details take a look at this repo Github.
Give, like a lot of other “frontend” plugins, relies on library code. WP libraries like
jQuery
can be dequeued but plugins’ libs e.g.$.qtip
which is bundled with Give can’t be in case I already have it included in my concatenated build file. It would be possible to just dequeue everything Give loads by using the provided hook but then looking up the entire script dependency chain, hooking it up into my concat task and also handle script translation would just be too much of a hassle and feel hackish.So for me as a developer the perfect solution for plugins loading JS/CSS on frontend would be a config option to disable all library code dependencies and only load application code. In case this config option is enabled the plugin would only register (
wp_register_script
) and localize (wp_localize_script
) it’s application script but not enqueue it (wp_enqueue_script
). Enqueuing would be left up to the developers in their script enqueuing function so that they’re able to ensure the order of scripts is correct. You’d have to include a list of frontend dependencies in the documentation so that devs aren’t required to read the source.If you’d consider this kind of approach let me know and I’ll help.
Give requires jquery. When the plugin is enabled it will enque the wordpress’s packaged jquery and load it in
<head>
.My guess is you’re loading an additional jquery (perhaps built with your other scripts) that’s causing a conflict.
I had the exact same problem. That’s why it would be really nice if all plugins had config options for disabling loading of library code for us purists.
Forum: Hacks
In reply to: Conditionally show custom widget in frontend sidebarThanks, even though in the end it’s still a hacky solution. Was hoping for something more proper.
I’ll opt for a single template only sidebar as I’m developing a complete website and am in control of the template.
Forum: Plugins
In reply to: Hierarchical taxonomy as custom post type path – URL rewrite issuesOK, so the custom rules should precede the wordpress ones. After prepending them to
rewrite_rules_array
everything works.Forum: Hacks
In reply to: WP_Query ordering insufficient, how to extend the SQL?Resolved.
Forum: Hacks
In reply to: WP_Query ordering insufficient, how to extend the SQL?Right, I forgot about the 4th add filter param.
add_filter('posts_orderby', 'custom_orderby', 10, 2);
Forum: Hacks
In reply to: WP_Query ordering insufficient, how to extend the SQL?Your callback is passed the WP_Query object as a second parameter
I’m not getting the second parameter.
function custom_orderby($orderby, $query = false) { if($query !== false) die(var_dump($query)); return $orderby; } add_filter('posts_orderby', 'custom_orderby');
I’m not getting any dies on templates with custom queries. Any idea?
Forum: Plugins
In reply to: [Polylang] Language choose not storing session or cookie?@chouby, this bit (core.php:486):
if (false === stripos($_SERVER['SCRIPT_NAME'], $GLOBALS['wp_rewrite']->index)) { $this->curlang = $this->get_preferred_language(); return; }
prevent the plugin from working correctly in my case. After commenting it out, everything worked flawlessly.
What is it for and is it really needed?
Forum: Plugins
In reply to: [Polylang] Language choose not storing session or cookie?Digging deeper
$this->curlang
is always default. Theget_current_language
method doesn’t update it because it always exits at the first check:if ($this->curlang) return $this->curlang;
Dumping $polylang on every page shows curlang always populated with the default language, no matter which language the post I’m viewing is in:
object(Polylang_Core)#201 (20) { ["curlang"]=> object(stdClass)#279 (9) { ["term_id"]=> string(1) "2" ["name"]=> string(13) "Sloven??ina" ["slug"]=> string(2) "sl" ["term_group"]=> string(1) "0" ["term_taxonomy_id"]=> string(1) "2" ["taxonomy"]=> string(8) "language" ["description"]=> string(5) "sl_SI" ["parent"]=> string(1) "0" ["count"]=> string(2) "92" } ...
Any idea what’ missing on my client’s server? Maybe a configuration setting or something. I need to get their sysadmin to give me full access. Meanwhile I’ll dig some more.
Forum: Plugins
In reply to: [Polylang] Language choose not storing session or cookie?I’d like to elaborate a bit on this.
The site I’ve developed with polylang works perfectly on my dev and staging environment (ubuntu, php 5.4.17(dev) 5.3.6(test), nginx) but on my client’s (cent os, php 5.3.3, apache) it doesn’t.
By visiting the site without cookies, the cookie is always set to the default language like so (default lang = sl):
domain.tld <-- redirects to /domov/ - cookie = sl domain.tld/domov/ <-- cookie = sl domain.tld/home/ <-- (english tl of /domov/) - cookie = sl domain.tld/startseite/ <-- (german tl of /domov/) -cookie = sl
On subsequent visit, the cookie value is never touched and stays at sl. Because of that, event though /home/ shows the english content, the menus, widgets and gettext translated template strings don’t change.
I know the cookie isn’t touched because I can manually edit its value. E.g. I change the cookie value to en and I get menus, widgets and template strings in english as expected.
I don’t have access to my client’s server right now and can’t look at the logs to debug this. Any idea what might be going on?
I’ve tried versions 1.1.3 and 1.1.4. Both work on my dev environment, none on my client’s.
Polylang’s settings:
Default lang: Slovenian Language set from content Remove /language/ Everything else unchecked except for a few synchronization items and 1 custom taxonomy.
Thanks
Forum: Plugins
In reply to: [Mailchimp List Subscribe Form] Multiple lists support (feature request)Yep, I did that. Thanks for reporting upstream.