这个PHP代码有什么功能?

时间:2018-05-28 22:38:58

标签: php web

我在我的第一个PHP项目中工作,我不明白这段代码的作用。愿有人帮帮我吗?

我不能用PHP工作。

import matplotlib.pyplot as plt


fig, ax = plt.subplots()

ax.set_xlim(0, 1920-1)
ax.set_ylim(0, 1080-1)

x,y = [0], [0]
# create empty plot
points, = ax.plot([], [], 'o')

# cache the background
background = fig.canvas.copy_from_bbox(ax.bbox)

def on_move(event):
    # append event's data to lists
    x.append(event.xdata)
    y.append(event.ydata)
    # update plot's data  
    points.set_data(x,y)
    # restore background
    fig.canvas.restore_region(background)
    # redraw just the points
    ax.draw_artist(points)
    # fill in the axes rectangle
    fig.canvas.blit(ax.bbox)


fig.canvas.mpl_connect("motion_notify_event", on_move)
plt.show()

基本上,这部分让我很困惑:

<?php

    $args = array(
        'post_type'   => 'manual-pdf',
        'post_status' => 'publish',
        'order'               => 'ASC',
        'orderby'             => 'title',
        'posts_per_page'         => -1,
        'meta_query'     => array(
        'relation' => 'AND',     
        // ['relation'] => 'OR', // use this for a different comparison
        array(
        'key' => 'wpcf-category',
        'value' => 2,
        'compare' => '='
        ),
        array(
        'key' => 'wpcf-version',
        'value' => 1,
        'compare' => '='
        )

        ));

    query_posts($args);
    if ( have_posts() ) :

        while (have_posts()): the_post();

    ?>
        <a target="_blank" href="<?=$url = types_render_field("url", array('raw' => 'false'));?>"><? the_title(); ?></a><br><?=$descricao = types_render_field("description", array('raw' => 'false'));?><hr>
    <?
        endwhile;

    else :
    endif;
    wp_reset_query();

    ?>

0 个答案:

没有答案