jQuery, WordPress

Ordinamento output plugin in post

Ecco uno snippet davvero utile per ordinare l’output dei plugin in un post di WordPress.
Dopo svariate ricerche, l’unico modo davvero valido rimane quello di modificare il DOM così

<script type="text/javascript">
  jQuery(document).ready(function($) { 
    
      $('#wpdevar_comment_1').insertAfter('.entry-author');
      $('.et_bloom_below_post').insertBefore('.entry-meta text-center');

   });
</script>

grazie alle direttive insertAfter() e insertBefore() di jQuery (grazie <3 jQuery), questa impostazione richiede 5 minuti.

Senza categoria

Modern Event Calendar

RISOLVERE MANCATO INVIO HTML EMAIL

cercare wp_mail_content_type  location solita: /app/libraries/factory.php e commentare la linea

// HTML email
$this->filter('wp_mail_content_type', array($this->main, 'html_email_type'));

ELIMINARE CONFERME EMAIL, LASCIARE SOLO QUELLA DI  CONFERMA

cercare email_verification e booking_confirmation file /app/libraries/notifications.php
commentare il metodo wp_mail

 

MODIFICARE IL CICLO DI REPLICA DEGLI INDIRIZZI EMAIL

Il tutto è all’interno della cartella /app/modules/booking/steps
La gestione è demandata ad un ciclo foreach di un array

 

 

PHP

CHMOD FILE CARTELLE SU FTP SENZA ACCESSO SSH

<?php
header('Content-Type: text/plain');

  /**
  * Changes permissions on files and directories within $dir and dives recursively
  * into found subdirectories.
  */
  function chmod_r($dir, $dirPermissions, $filePermissions) {
      $dp = opendir($dir);
       while($file = readdir($dp)) {
         if (($file == ".") || ($file == ".."))
            continue;

        $fullPath = $dir."/".$file;

         if(is_dir($fullPath)) {
            echo('DIR:' . $fullPath . "\n");
            chmod($fullPath, $dirPermissions);
            chmod_r($fullPath, $dirPermissions, $filePermissions);
         } else {
            echo('FILE:' . $fullPath . "\n");
            chmod($fullPath, $filePermissions);
         }

       }
     closedir($dp);
  }

  chmod_r(dirname(__FILE__), 0755, 0644);
?>

 

javascript, WordPress

Link WebApp stessa pagina

Quando si crea una web app, i link tendono ad aprirsi in una nuova finestra del browser, questo non deve succedere

<script type="text/javascript">
// fix link open new windows WebApp

(function(a,b,c){if(c in b&&b){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone")
	
</script>

Oppure in maniera selettiva escludendo singoli elementi (utile per gallerie immagini)

<script type="text/javascript">
jQuery('a:not(".asg-lightbox"):not([href^="#"])').live('click', function (event)
{      
    var href = jQuery(this).attr("href");

    if (href.indexOf(location.hostname) > -1)
    {
        event.preventDefault();
        window.location = href;
    }
});
</script>

 

Senza categoria

cache web app

La parte fondamentale è aggiungere vicino le risorse “statiche” il seguente parametro:

?v=’.time().’  o comunque un equivalente in qualsiasi linguaggio in grado di generare una stringa random, possibilmente mai identica in modo tale da forzare il dispositivo ad eseguire un refresh della cache.

echo '

<script src="./framework/js/catalogoMobileInit.js?v='.time().'"></script>
<script src="./framework/js/loadingoverlay.min.js?v='.time().'"></script>

';

 

Senza categoria

imapsync

 ./imapsync \
   --host1 46.252.149.34 --user1 booking@pianotre.it --password1 dEXf0Li^-Rwi \
   --ssl2 --host2 107.6.166.154 --user2 booking@pianotre.it --password2 dEXf0Li^-Rwi \
   --nofoldersizes --useuid --automap