Forum Replies Created

Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter Eggy

    (@zearth)

    I found alternative solution, here is my temp solution to prevent javascript code insert from non administrator.

    function filterjs( $data, $postarr, $unsanitized_postarr){

    global $current_user;

    $roleko = $current_user->roles[0];

    if($roleko == 'administrator') {

    } else {

    $postcontent = $data['post_content'];

    $postcontent = str_replace('<script','&lt;script',$postcontent );

    $postcontent = str_replace('</script>','&lt;/script&gt;',$postcontent );

    $data['post_content'] = ?$postcontent ;

    }

    return $data;

    }

    add_filter( 'wp_insert_post_data', 'filterjs',10,3);
    Thread Starter Eggy

    (@zearth)

    I want our editors to be able to embed <iframe> code only in the post editor. We don’t want them to post some javascript codes like <script>codes</script>. In this way the content being push to the frontend will allow them only to use iframe and no javascript embed codes in the editor content.

    Thread Starter Eggy

    (@zearth)

    thanks, it works!

    Thread Starter Eggy

    (@zearth)

    for the answer, override this filters

    add_action('pre_get_users', array($this, 'filterUserQuery'), 999);
    add_filter('rest_user_query', array($this, 'prepareUserQueryArgs'));

    Hi, I would like to know if you can check this function I did, current it works on previous version of relevanssi 3.x.x, but when I updated to the latest version its not working. I’m having the same issue from keviniseekie.

    add_filter('relevanssi_modify_wp_query', 'rlv_add_meta_query');
    function rlv_add_meta_query($query) {
    global $wpdb;
    	$tax_query = array(
    		'relation' => "AND",
    		array(
    			'taxonomy' => 'sectionpart',
    			'field'    => 'slug',
    			'terms'    => array('data'),
    		),
    		array(
    			'taxonomy' => 'rolepart',
    			'field'    => 'slug',
    			'terms'    => array('member','admin','mod'),
    		),
    		array(
    			'taxonomy' => 'category',
    			'field'    => 'term_id',
    			'terms'    => array(2,550,1350,551,589,1353),
    			'operator' => 'NOT IN',
    		),
    	);
    	$query->set('tax_query', $tax_query);
    	
    return $query;
    }

    it looks like it disregard this filter and not adding it. Can you help me in a way to fix this issue?

    thanks,

    Hi, thanks for the reply, I tried using it but the secondary parent category still auto check when I tried to click the third level category under second level category. I tried to update the plugin to the latest version but I still experience the issue.

    thanks,

    Is this possible for Level 2 Parent Categories?

    Is this possible for Level 2 Parent Categories?

    Thread Starter Eggy

    (@zearth)

    sorry I think I found the solution, the dates are publish and it should be future dates which is why it is not showing, thanks again

    Thread Starter Eggy

    (@zearth)

    here is my entry in the wp-admin post

    Event 1 (has english and italian post)
    Event 2 (has english and italian post)
    Event 3 (italian post only)
    Event 4 (italian post only)

    in english display it shows event 1 and 2, but when I switch to italian display it show post 1 and 2 only, the post 3 and 4 was not showing/visible on the loop under italian page

    Thread Starter Eggy

    (@zearth)

    i did that but the problem is it is not showing the italian post which is dedicated italian post and no english post counter part.

    here is the code I did

    $targs=array(
    'post_type' => array('post_event'),
    'showposts' => 1, 'lang' => 'it',
    'post_status' => 'future',
    'order' => 'ASC',
    'orderby' => 'date',
    );
    $lidqry = new WP_Query($targs);
    while ( $lidqry->have_posts() ) : $lidqry->the_post();
    $clink = get_permalink($post->ID);
    $ddats = get_the_date( $d );
    $ctdb = $post->post_content;
    $rdbl = explode('|!|',$ctdb);
    $newrow .= '<div class="nwrow">
    <div class="nwtm">'.$ddats.'</div>
    <a href="/it/news/events"><b>'.$post->post_title.'</b> - '.$rdbl[1].'</a>
    </div>
    ';;
    endwhile;
    wp_reset_query();

    TIA

    is there a fixed on this issued?

    Thread Starter Eggy

    (@zearth)

    never mind found the answer

    Thread Starter Eggy

    (@zearth)

    its now working, never mind the post above, I used

    add_rewrite_rule()

    to fix the issue

    thanks

    Thread Starter Eggy

    (@zearth)

    I think I found out now the problem on this error, as well on the top/parent pages causing the error. On my Template function I have a custom rewrite URL, if I remove this and reset the rewrite_rules it works ok, but if I add again it cause error on polylang url structure.

    Do you know a way on how on how I can hookup this on polylang which will side by side works ok? Thanks

    ///// rewrite a new permalink structure s
    add_filter('init','flushRules');
    add_filter('rewrite_rules_array','wp_insertMyRewriteRules');
    function flushRules(){
    global $wp_rewrite;
    $wp_rewrite->flush_rules();
    }
    
    function wp_insertMyRewriteRules($rules){
    $mypath = htmlspecialchars(strip_tags(trim($_SERVER["REQUEST_URI"])));
    $mypath = preg_replace('/(.*)\?(.*)/', '$1', $mypath);
    $urlbit = explode("/",$mypath);
    
    $newrules = array();
    $newrules['news/(press-release|in-the-press|case-studies|events|industry-insight)/?$'] = 'index.php?page_id='.NEWSSYSID.'&posttype=$matches[1]';
    $newrules['news/(press-release|in-the-press|case-studies|events|industry-insight)/page/([0-9]+)/?$'] = 'index.php?page_id='.NEWSSYSID.'&posttype=$matches[1]&paged=$matches[2]';
    $newrules['news/(press-release|in-the-press|case-studies|events|industry-insight)/archive/([0-9]+)/([0-9]+)/?$'] = 'index.php?page_id='.NEWSSYSID.'&posttype=$matches[1]&mm=$matches[3]&year=$matches[2]';
    $newrules['news/(press-release|in-the-press|case-studies|events|industry-insight)/archive/([0-9]+)/([0-9]+)/page/([0-9]+)/?$'] = 'index.php?page_id='.NEWSSYSID.'&posttype=$matches[1]&mm=$matches[3]&year=$matches[2]&paged=$matches[4]';
    $newrules['news/(press-release|in-the-press|case-studies|events|industry-insight)/archive/([0-9]+)/?$'] = 'index.php?page_id='.NEWSSYSID.'&posttype=$matches[1]&year=$matches[2]';
    $newrules['news/(press-release|in-the-press|case-studies|events|industry-insight)/archive/([0-9]+)/page/([0-9]+)/?$'] = 'index.php?page_id='.NEWSSYSID.'&posttype=$matches[1]&year=$matches[2]&paged=$matches[3]';
    
    return $newrules + $rules;
    }
    
    add_filter('query_vars', 'add_my_var');
    function add_my_var($public_query_vars) {
    $public_query_vars[] = 'posttype';
    $public_query_vars[] = 'mm';
    $public_query_vars[] = 'year';
    $public_query_vars[] = 'paged';
    return $public_query_vars;
    }
    ///// rewrite a new permalink structure e
Viewing 15 replies - 1 through 15 (of 19 total)