Forum Replies Created

Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter andrejcremoznik

    (@andrejcremoznik)

    I tracked this down through WP filesystem functions and PHP and found out that DISALLOW_FILE_MODS being true gives these errors.

    Thread Starter andrejcremoznik

    (@andrejcremoznik)

    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.

    Thread Starter andrejcremoznik

    (@andrejcremoznik)

    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

    Thread Starter andrejcremoznik

    (@andrejcremoznik)

    This 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

    andrejcremoznik

    (@andrejcremoznik)

    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.

    andrejcremoznik

    (@andrejcremoznik)

    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.

    Thread Starter andrejcremoznik

    (@andrejcremoznik)

    Thanks, 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.

    Thread Starter andrejcremoznik

    (@andrejcremoznik)

    OK, so the custom rules should precede the wordpress ones. After prepending them to rewrite_rules_array everything works.

    Thread Starter andrejcremoznik

    (@andrejcremoznik)

    Resolved.

    Thread Starter andrejcremoznik

    (@andrejcremoznik)

    Right, I forgot about the 4th add filter param.

    add_filter('posts_orderby', 'custom_orderby', 10, 2);

    Thread Starter andrejcremoznik

    (@andrejcremoznik)

    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?

    @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?

    Digging deeper $this->curlang is always default. The get_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.

    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

    Thread Starter andrejcremoznik

    (@andrejcremoznik)

    Yep, I did that. Thanks for reporting upstream.

Viewing 15 replies - 1 through 15 (of 22 total)