HEX
Server: Apache
System: Linux dotw660 5.10.0-37-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64
User: web350 (1012)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/clients/client125/web350/web/wp-content/plugins/wp-automatic/p_functions.php
<?php 

/* ------------------------------------------------------------------------*
 * Function Selected
* ------------------------------------------------------------------------*/
if(! function_exists('wp_automatic_opt_selected')){
	function wp_automatic_opt_selected($src,$val){
		
		if(stristr($src, ',')){
			//array
			$src= array_filter(explode(',', $src));
			
			 
			if(in_array($val, $src)){
				echo ' selected="selected" ';
			} 
				
			
		}else{
			if (trim($src)==trim($val)) echo ' selected="selected" ';
		}
	
	}
	
	/**
	 * function to display an option in a select box
	 */
	function wp_automatic_opt_display($displayName,$value,$selectedValue,$dataFilterVal=''){

		if(trim($dataFilterVal) != ''){
			$dataFilterValAttr = ' data-filter-val="'.$dataFilterVal.'" ';
		}
		
		echo '<option '.$dataFilterValAttr.' value="' . $value . '"' ; @wp_automatic_opt_selected( $value, $selectedValue ); echo '>'.$displayName.'</option>';
	
	}
}

/* ------------------------------------------------------------------------*
 * Function Selected
* ------------------------------------------------------------------------*/
if(! function_exists('check_checked')){
	function check_checked($val,$arr){
		//if(! is_array($arr)) return false;
			
		if(in_array($val,$arr)){
			echo ' checked="checked" ';
		}else{

			return false;
		}
			
	}
}

function wp_automatic_remove_quick_edit( $actions ) {
	global $post;
	if( $post->post_type == 'wp_automatic' ) {
		unset($actions['inline hide-if-no-js']);
	}
	return $actions;
}

if (is_admin()) {
	add_filter('post_row_actions','wp_automatic_remove_quick_edit',10,2);
}

if(! function_exists('wp_automatic_category')){

	/**
	 * Display category and it's childs
	 * @param unknown $cat
	 * @param unknown $childCats
	 */
	 
	function wp_automatic_category($category,&$childCats,$tax,$post_type,$camp_post_category,$prefix = ''){
		
		echo  '<option   data-tax="'.$tax.'" class="post_category post_'.$post_type.'" value="'.$category->cat_ID.'"';
		wp_automatic_opt_selected($camp_post_category,$category->cat_ID);
		echo '>'.$prefix.$tax.': '.$category->cat_name . '  (id='.$category->cat_ID.') (posts:'.$category->category_count.')';
		echo '</option>';
		
		$catChilds = array();
		
		if(isset($childCats[$category->cat_ID]))
		$catChilds = $childCats[$category->cat_ID];
		
		if(count($catChilds) > 0){
			foreach ($catChilds as $childCat){
				wp_automatic_category($childCat,$childCats,$tax,$post_type,$camp_post_category,$prefix .'— ');
			}
		}
		
		
	}
	

}
?>