-2

Actually, i asked a bad question previously and that question already there is Stackoverflow, so I'm editing it to a new question,

I want list of available contact form name and id to use in another plugin, How can fetch contact form name to some other plugin please give me solution,

I have a solution for fetching cf7 form-id, i want name also along with form id

  //code to fetch cf7 form-id

  $cf7_id_array = array();
    if (post_type_exists('wpcf7_contact_form')) {
        $args = array('post_type' => 'wpcf7_contact_form', 'post_per_page' => -1);
        $the_query = new WP_Query($args);
        if ($the_query->have_posts()) {
            while ($the_query->have_posts()) {
                $the_query->the_post();
                $cf7_id_array[] = get_the_ID();
            }
            wp_reset_postdata();
        }
    }
    return $cf7_id_array;
  • At [so] you are expected to try to **write the code yourself**. After **[doing more research](//meta.stackoverflow.com/questions/261592)** if you have a problem you can **post what you've tried** with a **clear explanation of what isn't working** and providing a [**Minimal, Complete, and Verifiable example**](//stackoverflow.com/help/mcve). I suggest reading [ask] a good question and [the perfect question](http://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/). Also, be sure to take the [tour] and read **[this](//meta.stackoverflow.com/questions/347937/)**. – John Conde Aug 02 '17 at 12:12
  • You are also expected to do a quick search for similiar questions before asking – RiggsFolly Aug 02 '17 at 12:13
  • I have changed question, please remove duplicate mark from my question, and give me solution, please @JohnConde – Deekshith Shetty Aug 24 '17 at 06:01

1 Answers1

1
$url="http://127.0.0.1/ideal/wp-content/uploads/2016/12/award-03.png";
$array=explode('/',&"$url);
$last=$array[count($array)].$array[count($array)-1].$array[co.  unt($array)-2];
echo $last;
Osama
  • 2,912
  • 1
  • 12
  • 15