I have oneplugin file testplugin.php..It contains variable $abc;
//main plugin.php
if(!is_admin()){
new Funtion_Button();
}
class Function_Button
{
if(is_single() || is_page() || is_home() ){
global $post;
global $wpdb;
$query_images_args = array(
'post_type' => 'attachment' , 'post_mime_type' =>'image','post_status' => 'published', 'posts_per_page' => -1,'numberposts' => 1
$query_images = new WP_Query( $query_images_args );
$images = array();
foreach ( $query_images->posts as $image) {
$images[]= wp_get_attachment_url( $image->ID );
}
$abc[]=0;
$abc= $abc.http_build_query($images);
$_SESSION['arrayImg']=$abc;
);
}
///recieving file
include ('testplugin.php');
session_start();
$array1[]=$abc;
Now this $abc is from main plugin page
But i am getting this error
Fatal error: Call to undefined function is_admin() in C:\wamp\www\wordpress\wp-content\plugins\testplugin.php on line 98
on 98 line i have if(!is_admin()){
Using session :
//On testplugin.php
//On another file
Using cookies :
//On testplugin.php
//On page 2