Forum Replies Created

Viewing 15 replies - 61 through 75 (of 212 total)
  • Thread Starter loopforever

    (@loopforever)

    Thank you for your response. I hope it is as you think.

    Thread Starter loopforever

    (@loopforever)

    I understood. Thank you so much @bcworkz

    Thread Starter loopforever

    (@loopforever)

    Thank you for your answer.
    However, I could not understand exactly what to write in this part of the code:

    if($roles[0]==’Customer’){
    $mime_types = array(
    //?
    );
    return $mime_types;
    }
    For example, the iphone uses the HEIC file extension.
    I couldn’t find the relevant extension on this site .
    So, is the following definition sufficient? So the user will be able to upload “images only”.

    function wpse_restrict_mimes($mime_types){
        //Get current user    
         $user = wp_get_current_user(); 
        //Obtaining the role 
          $roles = ( array ) $user->roles; 
    
    if($roles[0]=='Customer'){
        //Forbiden ALL
        unset( $mimes );
    
        $mime_types = array(
            //Image only
            $mimes['svg'] =   'image/svg+xml'; 
            $mimes['jpg'] =  'image/jpeg, image/pjpeg
            $mimes['jpeg'] = 'image/jpeg, image/pjpeg
            $mimes['png'] =  'image/png
    
        );
        return $mime_types;
    }
    }
    add_filter('upload_mimes', 'wpse_restrict_mimes');
    • This reply was modified 4 years, 6 months ago by loopforever.
    • This reply was modified 4 years, 6 months ago by loopforever.
    • This reply was modified 4 years, 6 months ago by loopforever.
    Thread Starter loopforever

    (@loopforever)

    Thank you for your answer.
    Unfortunately, theme support has expired and I can’t ask questions. That’s why I’m trying to fix the problem myself.
    The problem is in the front end, not the back end.
    I’m adding one more image to be more descriptive. Another example.
    Here

    Thread Starter loopforever

    (@loopforever)

    Hello,
    Some icons are not visible. Can you help me ?
    Image: Link

    Also, what could be the reason for this? Theme support has expired. I can’t contact the theme.

    Thread Starter loopforever

    (@loopforever)

    @daniel_richard and @rainfallnixfig thank you so much for your response.
    I will review these.

    Thread Starter loopforever

    (@loopforever)

    Thank you for your answer.
    I’ve looked at this place but have my doubts. Should I set a priority for each box separately?

    Thread Starter loopforever

    (@loopforever)

    Thank you very much for your reply.
    Why are these icons not appearing? Because others are not visible ?
    For example, this: https://i.ibb.co/Hp5rR9g/asbv.png
    It performs the function of returning, on mobile, in Dokan Store or any other place. However, it doesn’t appear.

    Thread Starter loopforever

    (@loopforever)

    I understood.
    Thank you very much for your reply and suggestion.
    Best regards.

    Thread Starter loopforever

    (@loopforever)

    Thank you so much.
    Hello again,
    The same problem exists in seller page > product > add new product. The icon (fa fa-cloud-upload) in the middle to add images is not visible.

    Thread Starter loopforever

    (@loopforever)

    Thanks again for your answer. Especially for taking the time to comment on this.
    I guess I’ll try to find another way. To answer your question, I would like to complete the section below.
    Isn’t it enough to be in the same loop? Am I wrong?
    “First foreach?? I don’t see any foreach in the function new_meta_for_member(). I’m looking at:”

    It’s here: Image Link

    Update: I read it again. I think this is your answer: “A foreach in some other calling process is of no help. Remember, all PHP variables are local in scope to the function unless declared global.”

    I want to ask one last thing to find another solution. Thank you again for your time.

    Below are two scenarios. The first one is the scenario that I have been dealing with for a few days, and which is the main question of this subject. The second is the “other way”, as I said at the beginning.

    1-) Collecting all the data in the registration form under a single meta key. There are about 30 text fields. Hence creating a serialized array.

    2-) The alternative is to create a separate meta key for each text field. The plugin allows this, as I said earlier. For example, a separate metadata for the date of birth, a separate metadata for the hobby … Again, of course, there are about 30 text fields.

    If I go the 2nd way, will I load too much into the database? Would this turn out to be a major performance issue for me? Actually, that’s why I’ve been trying to do the first scenario for days. I think there will be more queries as there are multiple rows and this will bloat the system. Am I wrong ?

    Where will I transfer this data?
    For each data–>, wp-admin>users>(any user)edit

    • This reply was modified 4 years, 8 months ago by loopforever.
    • This reply was modified 4 years, 8 months ago by loopforever.
    Thread Starter loopforever

    (@loopforever)

    Thank you very much for your response.
    “In new_meta_for_member() you have $get_meta_value[$req_key] = $data;, but $req_key is not assigned any value. “

    If you have noticed, this value is defined in the first foreach. So it’s not undefined.
    The only problem is to use this variable ($get_meta_value) in the other hook.
    How do I know it’s okay?
    If I save as meta key (add_user_meta) in the first hook, all values ​​are successfully saved in the database? Code Image Link

    What is the problem in such a case? : New meta key is generated repeatedly for values ​​in each loop.
    For example, in the database,

    ————meta_key———————–meta_value
    Loop 1 :member_new_meta—————a
    Loop 2: member_new_meta—————a,b
    Loop 3: member_new_meta—————a,b,c

    “Seems to me you’d only want to save the individual keyed value for each user. “
    Yes, I want to do exactly that. I’ll use them elsewhere later. But for now this is not important. The important thing is to save the data “under a single meta key” and “as an array”.

    What happens if I define global as you mentioned at the beginning?
    Only the final value is assigned. Consider the example above, in such a case not the value a,b,c; I can only get the value of c. Also, only one meta key occurs.
    meta_key————————meta_value
    member_new_meta ———–c

    • This reply was modified 4 years, 8 months ago by loopforever.
    • This reply was modified 4 years, 8 months ago by loopforever.
    • This reply was modified 4 years, 8 months ago by loopforever.
    • This reply was modified 4 years, 8 months ago by loopforever.
    • This reply was modified 4 years, 8 months ago by loopforever.
    • This reply was modified 4 years, 8 months ago by loopforever.
    • This reply was modified 4 years, 8 months ago by loopforever.
    • This reply was modified 4 years, 8 months ago by loopforever.
    • This reply was modified 4 years, 8 months ago by loopforever.
    Thread Starter loopforever

    (@loopforever)

    Yes, you’re right, I didn’t see that. Sorry. Of course, action is not like this normally.
    I’ve been struggling for a few days but couldn’t find a solution. I would really appreciate if you can help. I have prepared a detailed file for you:

    The file content I’m processing on: Link
    All file content: Link

    Thread Starter loopforever

    (@loopforever)

    As I said before, yes, I tried that but I can only get the last value.
    $new_value works in a foreach loop. So the first hook is defined in a loop. Because of this, I can’t get other values. I can only get the last inserted value
    .

    foreach($x as y){
    //...codes
      foreach($a as $b){
    //...codes
    //First Action in here
    do_action('vse_da_update',$id,$data[$rkey],$status);
      }
    }

    Just to be sure, I’ve redid the definition you said:

    add_action('vse_da_update', 'new_vse_da_update', 10, 2);
    function new_vse_da_update ($id, $data){
    global $new_value;
    $new_value[$id] = $data;
    }
    
    add_action('second_vse_da', 'new_vse_da_update', 10, 2);
    function new_vse_da_update ($id){
    global $new_value;
    add_user_meta($id, $new_value);
    }
    Thread Starter loopforever

    (@loopforever)

    Thank you very much for your reply. Problem is solved.

    • This reply was modified 4 years, 8 months ago by loopforever.
    • This reply was modified 4 years, 8 months ago by loopforever.
    • This reply was modified 4 years, 8 months ago by loopforever.
Viewing 15 replies - 61 through 75 (of 212 total)