Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter Timama

    (@timama)

    bcworkz ! you was right ! it is something wrong in the saving process. When i change

    if ('page' == $_POST['post_type']) {
            if (current_user_can('edit_page', $post_id)) {
                if (isset($_POST['audio_files'])) {
                    update_post_meta($post_id, 'audio_files', $_POST['audio_files']);
                }
            }
        }

    to just

    if ('page' == $_POST['post_type']) {
            if (current_user_can('edit_page', $post_id)) {
                if (isset($_POST['audio_files'])) {
                    update_post_meta($post_id, 'audio_files', $_POST['audio_files']);
                }
            }
        }

    all the audio are deleted….. okay.. I will check my test on saving. many thanks bcworkz !

    Thread Starter Timama

    (@timama)

    Many thanks for your answer bcworkz. I tried but it doesn’t work.

    I have something to add…. i’ve tried a lot of things. And that can help:

    when I have 3 audio files on my updated wordpress page, if I delete 2 of them and refresh, the two disappear.
    Now, if I delete all 3, well after refreshing the page, all 3 are still there.

    Maybe this case can help. Has someone already this problem or see what is going wrong? many thanks for your help once again

    I have the same problem since I have installed WordPress 5.0.3.

    On firefox or safari, when I clic on the link, the pdf is opened on another page. I can see the pdf.

    On Chrome, when I clic, anoter page is opened but the page is empty.

    And it worked before (not with WordPress 5.0.1 but before)
    I can open pdf in Chrome, when pdf doens’t come from wrodpress.
    When I click on a link, I can open a pdf and see it in chrome (when it comes from WordPress 4.9.8).

    it is not working since WordPress 5.0.3.

    Forum: Alpha/Beta/RC
    In reply to: Page Permalink issue
    Thread Starter Timama

    (@timama)

    ok I found.

    The plugin Custom permalink made trouble.
    I desactivated it and now it works : I habe the box on the right to modify the url of the page.

    Thread Starter Timama

    (@timama)

    HI ,

    Okay, the last code works… it was a hosting issue. That’s why the Email sending didn’t work…

    so, many thanks, the last code I sent work….

    solved !

    Thread Starter Timama

    (@timama)

    wouaouh, okay that is a really good answer !
    Many thanks bcworkz.

    Yes, i have check my spam but nothing there…
    I have also already tried with wp_mail (as i saw it wasn’t working, i tried a few things … 😉 )
    and the according to what you said, i am going to keep wp_mail.

    then, i will check DNSreport…. there is an issue actually with the mail of the hosting. But i thought that didn’t interfer with what i do…. i check..

    thanks again !

    Thread Starter Timama

    (@timama)

    when I use the following code

    function boutoncode($atts, $content = null) {
        global $wpdb;
        extract(shortcode_atts(array(
        'lien' => '#',
        'couleur' =>'bleu'
        ), $atts));
      
        $codecode = ' 
        <form method="post" >
        <input class="bouton '.$couleur.'"  type="submit" name="envoyer" value="Cliquez ICI pour recevoir par Email le CODE PROMO" />
        </form>';
    
        $postcode = $_POST['envoyer'];
    
        if ( isset($postcode) ) {   
    
            // Code PHP pour traiter l'envoi de l'email - header général
            if (!preg_match("#^[a-z0-9._-]+@(hotmail|live|msn).[a-z]{2,4}$#", '[email protected]'))
            {
            $passage_ligne = "\r\n";
            }
            else
            {
            $passage_ligne = "\n";
            }
            $headers = 'From: MAplus'.$passage_ligne;
            $headers .= "MIME-Version: 1.0".$passage_ligne;
            $headers .= 'Content-type: text/html; charset=UTF-8' .$passage_ligne;          
            mail('[email protected]', 'test shortcode', 'test', $headers);
    
            if (mail('[email protected]', 'test shortcode', 'test', $headers)==true)
            {
                echo 'ENVOI';
            }
            else
            {
                echo ' PB ENVOI'; 
            }
            //  include("send-email-contact.php"); 
         }
    
        return $codecode;
         
    }
       add_shortcode('boutoncode', 'boutoncode');

    the text “ENVOI” is written. Son that means that the function mail () return true… but i don’t receive any Email…

    have you got a tip for me ?

    many thanks

    Thread Starter Timama

    (@timama)

    okay, i have tried to take out the action “send an Email” from the return.

    I have this code :

    function boutoncode($atts, $content = null) {
        global $wpdb;
        extract(shortcode_atts(array(
        'lien' => '#',
        'couleur' =>'bleu'
        ), $atts));
      
        $codecode = ' 
        <form method="post" >
        <input class="bouton '.$couleur.'"  type="submit" name="envoyer" value="Cliquez ICI pour recevoir par Email le CODE PROMO" />
        </form>';
    
        $postcode = $_POST['envoyer'];
    
        if ( isset($postcode) ) {   
    
            // Code PHP pour traiter l'envoi de l'email - header général
            if (!preg_match("#^[a-z0-9._-]+@(hotmail|live|msn).[a-z]{2,4}$#", $email))
            {
            $passage_ligne = "\r\n";
            }
            else
            {
            $passage_ligne = "\n";
            }
            $headers = 'From: MAplus'.$passage_ligne;
            $headers .= "MIME-Version: 1.0".$passage_ligne;
            $headers .= 'Content-type: text/html; charset=UTF-8' .$passage_ligne;          
            mail('[email protected]', 'test shortcode', 'test', $headers);
            echo 'ENVOI ?'; 
            //  include("send-email-contact.php"); 
         }
    
        return $codecode;
         
    }
       add_shortcode('boutoncode', 'boutoncode');

    I have the button, and when I click, the text “ENVOI?” appears, but i don’t receive any Email.

    Then, i don’t know if I can send an Email like this or if I am wrong with using mail() founction.

    Many thanks for you help

    Thread Starter Timama

    (@timama)

    okay, i still have problem. I don’t know how to exectite the action “send an Email”.

    I have :

    function boutoncode($atts, $content = null) {
        extract(shortcode_atts(array(
        'lien' => '#',
        'couleur' =>'bleu'
        ), $atts));
      
        $codecode = ' 
        <form method="post" >
        <input class="bouton '.$couleur.'"  type="submit" name="envoyer" value="Cliquez ICI pour recevoir par Email le CODE PROMO" />
        </form>';
    
        $postcode = $_POST['envoyer'];
    
        if ( isset($postcode) ) {   
            //$emailcode = " wp_mail( '[email protected]', 'test shortcode', do_shortcode($message), $headers, $attachments )";
            $headers = 'From: Maplus';
            $emailcode = mail('[email protected]', 'test shortcode', 'test', $headers); 
            //  include("send-email-contact.php"); 
         }
    
        return $codecode . $emailcode;
         
    }
       add_shortcode('boutoncode', 'boutoncode');

    ANd when I click, that returns 1 (not true or false but 1).

    And when in the code I use = ‘ ‘ for $emailcode like
    $emailcode = 'mail('[email protected]', 'test shortcode', 'test', $headers)';

    that return the text of the code…. that writes the text of the code on the screen.

    DO you see which problem is it?
    Could you help me?

    many thanks for your help

    Thread Starter Timama

    (@timama)

    i have tried this code

    /* Shortcode bouton */
    function boutoncode($atts, $content = null) {
        extract(shortcode_atts(array(
        'lien' => '#',
        'couleur' =>'bleu'
        ), $atts));
      
        $codecode = ' 
        <form method="post" >
        <input class="bouton '.$couleur.'"  type="submit" name="envoyer" value="Cliquez ICI pour recevoir par Email le CODE PROMO" />
        </form>';
    
        $postcode = $_POST['envoyer'];
    
        
        if ( isset($postcode) ) {   
            $emailcode =' TEST';
            //  include("send-email-contact.php"); 
         }
    
        return $codecode . $postcode . $emailcode;
         
    }
       add_shortcode('boutoncode', 'boutoncode');
    

    and when I click, my post is written and ‘TEST’ too..
    so maybe it works.
    i’m going to try to send an Email…
    then I come bakc (with the solution I hope”

    Thread Starter Timama

    (@timama)

    then I used <form>

     function boutoncode($atts, $content = null) {
        extract(shortcode_atts(array(
        'lien' => '#',
        'couleur' =>'bleu'
        ), $atts));
      
        $codecode = ' 
        <form method="post" >
        <input class="bouton '.$couleur.'"  type="submit" name="envoyer" value="Cliquez ICI pour recevoir par Email le CODE PROMO" />
        </form>';
    
        $postcode = $_POST['envoyer'];
    
        $emailcode ='
        if ( isset($postcode) ) {   
            echo "TEST";
            //  include("send-email-contact.php"); 
         }';
    
        return $codecode . $postcode . $emailcode;
         
    }
       add_shortcode('boutoncode', 'boutoncode');

    and with
    – $codecode : i have the button on which i have to click
    – $postcode : i have now a value (of course… )
    – $emailcode : i have the code written on the screen

    if ( isset($postcode) ) { echo "TEST"; // include("send-email-contact.php"); }

    that’s this part i don’t really know how to do…. having the Email sending and in the same time the button (all in return?)..

    i am still searchiing .. i continue..

    Thread Starter Timama

    (@timama)

    Many thanks bcworkz….

    of course !
    I began with a thing like

    <a class="bouton '.$couleur.'" href="'.$lien.'" target="_blank">' . do_shortcode($content) . '</a>';

    then,as I wanted an action, i have changed for an input .. and forgot the method=”post”…

    i think i have already tried (because i tried a lot of things) … i do it and come back.

    Thread Starter Timama

    (@timama)

    when I do the following code, of course the button doesn’t appear and the return return the code (the condition doesn’t work in a way)

    function boutoncode($atts, $content = null) {
        extract(shortcode_atts(array(
        'lien' => '#',
        'couleur' =>'bleu'
        ), $atts));
      
        $codecode = ' <input class="bouton '.$couleur.'"  type="submit" name="envoyer" value="Cliquez ICI pour recevoir par Email le CODE PROMO" />';
    
        $postcode = $_POST['envoyer'];
    
        $emailcode ='
        if ( isset($postcode) ) {   
            echo "TEST";
            //  include("send-email-contact.php"); 
         }';
    
        
        return $emailcode;
         
    }
       add_shortcode('boutoncode', 'boutoncode');

    I am searching

Viewing 13 replies - 1 through 13 (of 13 total)